Website Membership - Admin Notification upon new user

By Mikey - November 3, 2011

Is there a method within "Website Membership" to notify an Administrator when someone has signed up for a new account?

If there is, can someone please point me in the right direction to activate, or a thread that discusses how to.

If not, is there some other add-on that that will achieve this?

I've searched the forum for hours now with no luck finding anything about how to do this.

Thanks, Zick

Re: [zick] Website Membership - Admin Notification upon new user

By Jason - November 4, 2011

Hi,

If you go onto the signup page, under the code that sends an email to the user, you can add code to send an email to the administrator as well.

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/

Re: [Jason] Website Membership - Admin Notification upon new user

By Mikey - November 4, 2011

Jason,
I've tried both of the methods below in bold, but it doesn't work... any suggestions on what I'm doing wrong?

// send message
$emailTemplate = "emails/user-new-signup.php";
$emailHeaders = emailTemplate_load(array(
'template' => websiteLogin_pluginDir() . "/$emailTemplate",
'subject' => '', // set in template
'from' => '', // set in template
'to' => $_REQUEST['email'],
//'to' => $_REQUEST['email'],'john.doe@domain.com',
'cc' => 'john.doe@domain.com',
'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'],
),
));
$mailErrors = sendMessage($emailHeaders);
if ($mailErrors) { die("Mail Error: $errors"); }

Re: [zick] Website Membership - Admin Notification upon new user

By Jason - November 7, 2011


---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [zick] Website Membership - Admin Notification upon new user

By Jason - November 7, 2011

Hi,

Sorry my last post didn't show up. I'm not sure what happened there.

Try something like this:

// send message
$emailTemplate = "emails/user-new-signup.php";
$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'],
),
));

@$emailHeaders['headers']['CC'] = "john.doe@domain.com";
$mailErrors = sendMessage($emailHeaders);

if ($mailErrors) { die("Mail Error: $mailErrors"); }


This adds the CC to the $emailHeaders array just before sendMessage is called.

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/