Membership Plugin - Full Name In Welcome Email
3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: December 24, 2012 (RSS)
I have been struggling with having the Welcome E-mail display the users full name in the email after they sign up.
If I put <?php echo htmlspecialchars($PLACEHOLDERS['username']) ?> in place after the Hello, I successfully get the email to display their username.
But, if I change it to <?php echo htmlspecialchars($PLACEHOLDERS['fullname']) ?> I get an error message in the email that says this: Hello Notice: Undefined index: fullname in /XXX/XXXX/XXXXXXX/XXXX/plugins/emails/user-new-signup.php on line 44
I have tried a few different things and can never get it to display "Hello John Smith,"
Any advice or guidance?
By Jason - December 21, 2012
Hi,
Thanks for posting! You're right that you need to put <?php echo htmlspecialchars($PLACEHOLDERS['fullname']) ?> in your email. After that, you need to put the user's fullname into the placeholder array.
If you take a look in your signup page, you will see this code which is generating your email. Add in fullname like this:
$emailHeaders = emailTemplate_load(array(
'template' => websiteLogin_pluginDir() . "/$emailTemplate",
'subject' => '', // set in template
'from' => '', // set in template
'to' => $_REQUEST['email'],
'placeholders' => array(
'username' => array_key_exists('username', $_REQUEST) ? $_REQUEST['username'] : $_REQUEST['email'], // if using email as username then show that instead
'password' => $password,
'loginUrl' => "http://" . $_SERVER['HTTP_HOST'] . $GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL'],
'fullname' => $_REQUEST['fullname'],
),
));
That should take care of the issue for you.
Hope this helps,
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/