XoopsX/legacy — pull request #71 by nao-pon (2014-07-05 04:43:35+00:00)
Title: [user] add delegate points before xoopsmailer->send() with `xoopsmailer`

[user] add delegate points before xoopsmailer->send() with `xoopsmailer`

- sample preload (html/preload/UserPreSendMail.class.php)
```php
mRoot->mDelegateManager->add('Legacy.Event.RegistUser.SendMail'
, array($this ,'preSendMail'));
}

function preSendMail(&$mailer, $action) {

/* COMMON PROCESS */

/* EDIT SUBJECT */
//$subject = $mailer->getVar('subject');
//$mailer->setSubject('['.$action.'] ' . $subject);

/* CHANGE MAIL FROM */
//$mailer->setFromEmail('example@example.com');
//$mailer->setFromName('XOOPS Cube Legacy Site');

/* PROCESS OF EACH ACTION */

switch($action) {
case 'LostPass1' :
break;
case 'LostPass2' :
break;
case 'Activated' :
break;
case 'Register' :
/* CHANGE TEMPLATE */
//$mailer->setTemplate('register_custom.tpl');
break;
case 'AdminActivate' :
break;
case 'Notify' :
break;
}
}
}
```