Okay
  Public Ticket #2812061
New user Approval email notification
Closed

Comments

  •  3
    Bartosz Haladus started the conversation

    Hello,

    I would like to customize the notification email to the customer once the B2B user is manually approved so it includes the login credentials as a reminder.

    I saw how to edit the default template but do not know how to properly use the hooks for the user name and password variables. 

    Can you please help with that?

    So I would like the email to look like this:

    "Congratulations! Your account has been approved. 

    Click here to login with the credentials given below:

    Username: 

    Password: 

    "


  •  2,217
    WebWizards replied

    Hi Bartosz,

    You could include the username, I believe with the following code, added to the email template file:

    $recipient = $email->recipient;
    $user = get_user_by('email', $recipient);
    $username = $user->user_login;
    echo 'Your username is: '.$username;    
    

    However, it's not possible to display the password, as the password is encrypted in the database, and is impossible to access. The only way to display the password there would be to reset it, but that could also create confusion for the user (because the password the user initially set would not work).


    Kind regards,

    Stefan