-
-
Save exside/5072393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ActivateNotify Plugin | |
by Breezer | |
http://forums.modx.com/index.php?topic=53213.0%3Bwap2 | |
8/15/2010 7:12 pm est | |
*/ | |
if ($modx->event->name == 'OnUserActivate') { | |
// array of emails to send the notification | |
$mailto =array('[email protected]','anotheremail@anycom'); | |
$mailfrom = $modx->getOption('emailsender'); | |
// email subject | |
$subject = 'New User Activation at '.$modx->getOption('site_name'); | |
// email body | |
$body = 'A user was activated on the site.'; | |
if (!empty($mailto)) { | |
foreach($mailto as $key => $value){ | |
$modx->getService('mail', 'mail.modPHPMailer'); | |
$modx->mail->set(modMail::MAIL_BODY, $body); | |
$modx->mail->set(modMail::MAIL_FROM, $mailfrom); | |
$modx->mail->set(modMail::MAIL_FROM_NAME, 'MODx'); | |
$modx->mail->set(modMail::MAIL_SENDER, 'MODx'); | |
$modx->mail->set(modMail::MAIL_SUBJECT, $subject); | |
$modx->mail->address('to',$value); | |
$modx->mail->setHTML(true); | |
$modx->mail->send(); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment