summaryrefslogtreecommitdiff
path: root/inc/mail.php
diff options
context:
space:
mode:
authorChris Smith <chris@jalakai.co.uk>2007-09-30 14:46:03 +0200
committerChris Smith <chris@jalakai.co.uk>2007-09-30 14:46:03 +0200
commit348e3c031361db0af261baa917bc8f2a09139695 (patch)
tree20ec17c168a100aedd954dec478b26fba0634103 /inc/mail.php
parent66d29756d694e33b59f52ecbb2092667f20de556 (diff)
downloadrpg-348e3c031361db0af261baa917bc8f2a09139695.tar.gz
rpg-348e3c031361db0af261baa917bc8f2a09139695.tar.bz2
corrections for earlier MAIL_MESSAGE_SEND patch :)
darcs-hash:20070930124603-d26fc-599122159a088c92dbbe3ed3fb10dc376d40c54e.gz
Diffstat (limited to 'inc/mail.php')
-rw-r--r--inc/mail.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/inc/mail.php b/inc/mail.php
index b677c2b38..d908c009c 100644
--- a/inc/mail.php
+++ b/inc/mail.php
@@ -34,11 +34,27 @@
* @see mail()
*/
function mail_send($to, $subject, $body, $from='', $cc='', $bcc='', $headers=null, $params=null){
+
$message = compact('to','subject','body','from','cc','bcc','headers','params');
- trigger_event('MAIL_MESSAGE_SEND',$message,'_mail_send');
+ return trigger_event('MAIL_MESSAGE_SEND',$message,'_mail_send_action');
}
-function _mail_send($to, $subject, $body, $from='', $cc='', $bcc='', $headers=null, $params=null){
+function _mail_send_action($data) {
+
+ // retrieve parameters from event data, $to, $subject, $body, $from, $cc, $bcc, $headers, $params
+ $to = $data['to'];
+ $subject = $data['subject'];
+ $body = $data['body'];
+
+ // add robustness in case plugin removes any of these optional values
+ $from = isset($data['from']) ? $data['from'] : '';
+ $cc = isset($data['cc']) ? $data['cc'] : '';
+ $bcc = isset($data['bcc']) ? $data['bcc'] : '';
+ $headers = isset($data['headers']) ? $data['headers'] : null;
+ $params = isset($data['params']) ? $data['params'] : null;
+
+ // end additional code to support event ... original mail_send() code from here
+
if(defined('MAILHEADER_ASCIIONLY')){
$subject = utf8_deaccent($subject);
$subject = utf8_strip($subject);