- // Send mail to member
- $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_request", "", $GLOBALS['userid']);
- SEND_EMAIL($GLOBALS['userid'], NL_MEMBER_SUBJECT, $msg);
-
- // Send mail to all admins
- if (GET_EXT_VERSION("admins") >= "0.4.1")
- {
- SEND_ADMIN_EMAILS_PRO(NL_ADMIN_SUBJECT, "admin_newsletter_request", "", $GLOBALS['userid']);
- }
- else
- {
- SEND_ADMIN_EMAILS(NL_ADMIN_SUBJECT, $admin_msg);
- }
-
- // Display message
- LOAD_TEMPLATE("admin_settings_saved", false, NL_MEMBER_REQUEST_DONE);
-}
- elseif ($span > 0)
-{
- // Already ordered
- LOAD_TEMPLATE("admin_settings_saved", false, NL_MEMBER_REQUEST_ALREADY);
-}
- else
-{
- // Load template for the note
- define('NL_MEMBER_NOTE', LOAD_TEMPLATE("member_newsletter_note", true));
-
- // Set status message and submit button
- switch ($status)
- {
- case "Y": // Receives the newsletter
- define('__STATUS_VALUE', NL_MEMBER_ON);
- define('__UNTIL_VALUE', "");
- define('NL_SUBMIT', NL_MEMBER_SUBMIT_OFF);
- break;
-
- case "N": // Does not receive the newsletter
- define('__STATUS_VALUE', NL_MEMBER_OFF);
- define('__UNTIL_VALUE', MAKE_DATETIME($until, "2"));
- define('NL_SUBMIT', NL_MEMBER_SUBMIT_ON);
- break;
- }