Public Ticket #2812061

New user Approval email notification

Closed
Comments
13 Tickets 4
Bartosz Haladus started the conversation 5 years ago on June 26, 2021 at 1:57pm

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,762
KingsPlugins replied 5 years ago on June 28, 2021 at 12:54am

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

Sign In