Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Website Membership - Admin Notification upon new user

 

 


zick
User

Nov 3, 2011, 9:25 PM

Post #1 of 6 (804 views)
Shortcut
Website Membership - Admin Notification upon new user Can't Post

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


Jason
Staff / Moderator


Nov 4, 2011, 10:34 AM

Post #2 of 6 (728 views)
Shortcut
Re: [zick] Website Membership - Admin Notification upon new user [In reply to] Can't Post

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 - Programmer 
interactivetools.com

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


zick
User

Nov 4, 2011, 12:12 PM

Post #3 of 6 (717 views)
Shortcut
Re: [Jason] Website Membership - Admin Notification upon new user [In reply to] Can't Post

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


Code
 
// 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"); }



Jason
Staff / Moderator


Nov 6, 2011, 10:23 PM

Post #4 of 6 (596 views)
Shortcut
Re: [zick] Website Membership - Admin Notification upon new user [In reply to] Can't Post

 
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

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


nmsinc
User

Nov 7, 2011, 6:57 AM

Post #5 of 6 (582 views)
Shortcut
Re: [zick] Website Membership - Admin Notification upon new user [In reply to] Can't Post

Hi zick,

I accomplished this by duplicating the "user-new-signup.php file located in the "Membership/email" folder - find the code listed below in on or about line 10:

// Override email headers - uncomment these to override the values set by the calling program
global $SETTINGS, $FROM, $TO, $SUBJECT, $PLACEHOLDERS;
$FROM = $SETTINGS['adminEmail'];
//$TO = $SETTINGS['adminEmail']; // set by program
$SUBJECT = "{$_SERVER['HTTP_HOST']} Account Details";

Make the following edits below and rename the duplicate file "admin-new-signup.php" and place in the "Membership/email" folder

// Override email headers - uncomment these to override the values set by the calling program
global $SETTINGS, $FROM, $TO, $SUBJECT, $PLACEHOLDERS;
//$FROM = $SETTINGS['adminEmail'];
$TO = $SETTINGS['adminEmail']; // set by program
$SUBJECT = "{$_SERVER['HTTP_HOST']} Account Details";

I then add an addtional email set in the user-signup.php file as follows (this way you could control the text sent to the admin) - notice that the second email set is now going to the admin!

// 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'],
),
));
$mailErrors = sendMessage($emailHeaders);
if ($mailErrors) { die("Mail Error: $errors"); }


// send message
$emailTemplate = "emails/admin-new-signup.php";
$emailHeaders = emailTemplate_load(array(
'template' => websiteLogin_pluginDir() . "/$emailTemplate",
'subject' => '', // set in template
'from' => $_REQUEST['email'],
'to' = $SETTINGS['adminEmail'], // set by program
'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"); }


-------- That's It -------


(This post was edited by nmsinc on Nov 7, 2011, 8:45 AM)


Jason
Staff / Moderator


Nov 7, 2011, 9:21 AM

Post #6 of 6 (572 views)
Shortcut
Re: [zick] Website Membership - Admin Notification upon new user [In reply to] Can't Post

Hi,

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

Try something like this:


Code
// 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 - Programmer 
interactivetools.com

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