Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Sanjeev Aryal

    (@sanzeeb3)

    @estalhun – no plans for now to integrate specific translation plugins.

    Just in case it helps, there are hooks before & after sending emails:

    “come_back_before_email_sent”
    “come_back_after_email_sent”

    which looks helpful to integrate something like that.

    Thread Starter estalhun

    (@estalhun)

    Dear Sanjeev,

    The variables of these hooks do not contain any user information e.g. user id or user name. So, I do not know the language to set.

    Best regards,
    István

    Plugin Author Sanjeev Aryal

    (@sanzeeb3)

    Ah, good point. That can be added if required. Can you add $user as a 2nd param and see if that works?

    Ill later update it. Or if you could create a PR, that would be appreciated: https://github.com/sanzeeb3/come-back/pulls

    thanks,

    Thread Starter estalhun

    (@estalhun)

    Hi,

    I did it on github.

    Best regards,
    István Borsányi

    Thread Starter estalhun

    (@estalhun)

    And I use this code in my custom php file:

    add_action( ‘come_back_before_email_sent’, ‘set_user_language’,10,2);
    function set_user_language($email_object=”, $user) {
    if( function_exists(‘trp_get_user_language’) ) { //TRP is active
    $user_language = trp_get_user_language( $user->ID );
    trp_switch_language( $user_language );
    }
    }

    add_action( ‘come_back_after_email_sent’, ‘restore_user_language’,10,2);
    function restore_user_language($email_object=”, $user) {
    if( function_exists(‘trp_restore_language’) ) { //TRP is active
    trp_restore_language();
    }
    }

    Plugin Author Sanjeev Aryal

    (@sanzeeb3)

    great. Thanks for the contribution. You can also write your WP username in readme.txt as contributors.

    have a good one! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘TranslatePress compatibility’ is closed to new replies.