Open mikek03 opened 4 years ago
Workaround is to add variables in blocks like these here https://github.com/salesagility/SuiteCRM/blob/master/modules/Users/User.php#L2301
$htmlBody = str_replace('$contact_user_first_name', $this->first_name, $htmlBody);
$body = str_replace('$contact_user_first_name', $this->first_name, $body);
The fields are from User beans, not contact beans.
A proper fix is to make this code use full template parsing capabilities.
Thanks @pgorod, that works perfectly.
Glad to hear it, but please reopen the issue, this is not fixed yet ;-)
SuiteCRM provides a function to generate a password and email the user on new user account creation. The email that is sent is configured in Admin->Password Management under Email Templates->For system-generated password. I've used the "Edit" button to edit the predefined template and wish to include an element of personalisation, addressing the email Dear UserLastName but when insering the variable for either User Last Name (which generates $contact_user_last_name) or Employee Last Name (which generates $employee_last_name), it does not get replaced when the email is sent.
Expected Behavior
When editing the email template for "system-generated password", I place custom text including variables for $contact_user_first_name or other $contactuser..... variables. When SuiteCRM sends the new user the email, these should be replaced with the user's information, for example if I place Dear $contact_user_first_name in the template, the email should say "Dear Mike".
Actual Behavior
When the email is delivered, it simply reads "Dear $contact_user_first_name", the variable is not replaced during send.
Steps to Reproduce
Context
Trying to onboard a number of users for a system hosted on behalf of a client. The users are suspicious about receiving an email that is not personalised.
Your Environment