• Resolved bmvcommunication

    (@bmvcommunication)


    Hello,

    Since I updated the plug-in to version 2.5.3, the notification emails are not working correctly. Here’s what I receive:

    "%1$s (%2$s) a demandé l'approbation d'un compte sur %3$s"

    I managed to temporarily solve the problem by deactivating the translation directly from the /new-user-approve/includes/messages.php file, by replacing:

    function nua_default_notification_message() {
    	$message = __( '{username} ({user_email}) has requested a username at {sitename}', 'new-user-approve' ) . "\n\n";
    	$message .= "{site_url}\n\n";
    	$message .= __( 'To approve or deny this user access to {sitename} go to', 'new-user-approve' ) . "\n\n";
    	$message .= "{admin_approve_url}\n\n";
    
    	$message = apply_filters( 'new_user_approve_notification_message_default', $message );
    
    	return $message;
    }

    With :

    function nua_default_notification_message() {
    	$message = "{username} ({user_email}) has requested a username at {sitename} \n\n";
    	$message .= "{site_url}\n\n";
    	$message .= "To approve or deny this user access to {sitename} go to \n\n";
    	$message .= "{admin_approve_url}\n\n";
    
    	$message = apply_filters( 'new_user_approve_notification_message_default', $message );
    
    	return $message;
    }

    This solution works, but the email is no longer translated. Do you have a solution to reinstate the translation?

    Thank you for your help,
    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bmvcommunication

    (@bmvcommunication)

    I finally found a solution to translate:

    In the file /new-user-approve/localization/new-user-approve-fr_FR.po, I replaced the line:

    #: includes/messages.php:87 
    #, fuzzy 
    msgid "{username} ({user_email}) has requested a username at {sitename}"
    msgstr "%1$s (%2$s) has requested account approval on %3$s"

    With :

    #: includes/messages.php:87 
    #, fuzzy 
    msgid "{username} ({user_email}) has requested a username at {sitename}"
    msgstr "{username} ({user_email}) has requested account approval on {sitename}"

    Then I replaced the new-user-approve-fr_FR.mo file with a new one generated using an online converter (Example: https://po2mo.net).
    Now the email is translated, and the variables work.

    Best regards

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @bmvcommunication,

    Thanks for reaching us,

    Hope you are doing well, Please don’t make any hardcoded changes in the plugin. Kindly use the loco translate plugin to update the translations.

    If you have any questions, feel free to reach out. We’re here to assist you.

    Thanks & Regards
    WP Experts Support Team

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Notification email error’ is closed to new replies.