
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)
|