Website Membership Registration form
3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 19, 2018 (RSS)
By gversion - July 17, 2018
Hello,
On my membership registration form I ask the user to select their "title" (e.g. Mr, Mrs, Miss) and also enter their surname. I would like to use these to fields in the salutation of the welcome email (USER-SIGNUP) that is sent to the user. Currently it is just "Hello {{first name}}"
I have tried editing websiteMembership.php as follows:
function wsm_sendSignupEmail($userNum, $passwordText) {
$user = mysql_get(accountsTable(), $userNum);
$emailHeaders = emailTemplate_loadFromDB(array(
'template_id' => 'USER-SIGNUP',
'placeholders' => array(
'user.title' => $user['title'],
'user.first_name' => $user['first_name'],
'user.last_name' => $user['last_name'],
'user.username' => $user['username'],
'user.email' => $user['email'],
'user.password' => $passwordText,
'loginUrl' => realUrl($GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL']),
)));
$mailErrors = sendMessage($emailHeaders);
I have also edited the email template in the cmsb admin area to display the placeholder fields:
Dear #user.title# #user.last_name#,
However the placeholders are not being updated with the user's details.
Could someone please tell me what else I need to do in order to make this work?
Thank you very much!
Regards,
Greg
By leo - July 19, 2018
Hi Greg,
I have just tested the feature locally and it works without an issue. Could you let me know what does the returning email look like? Also make sure the $user variable has the fields you want to pass as placeholders.
Thanks,
interactivetools.com
By gversion - July 19, 2018
Hi Leo,
Thanks for checking this for me. I just realised I have built a custom "pending users" file, which is actually responsible for sending out the "welcome" email so I just needed to edit this file and now it works!
Thanks again.
Regards,
Greg