From 21693295474f5acaa21526ae05fa80a731eb1a6a Mon Sep 17 00:00:00 2001 From: Chris Case Date: Wed, 16 Feb 2011 08:05:10 -0800 Subject: forgot to check this in earlier... splits up text and html into two different templates and base64 encodes them --- mod/dfrn_notify.php | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 5f91f1b1b..040263b0c 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -210,10 +210,23 @@ function dfrn_notify_post(&$a) { = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "
\n",$msg['body'])))); // load the template for private message notifications - $tpl = load_view_file('view/mail_received_eml.tpl'); + $tpl = load_view_file('view/mail_received_html_body_eml.tpl'); + $email_html_body_tpl = replace_macros($tpl,array( + '$siteName' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $importer['thumb'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $importer['url'], // full url for the site + '$from' => $msg['from-name'], // name of the person sending the message + '$title' => stripslashes($msg['title']), // subject of the message + '$htmlversion' => $msg['htmlversion'], // html version of the message + '$mimeboundary' => $msg['mimeboundary'], // mime message divider + '$hostname' => $a->get_hostname() // name of this host + )); - // import the data into the template - $email_tpl = replace_macros($tpl, array( + // load the template for private message notifications + $tpl = load_view_file('view/mail_received_text_body_eml.tpl'); + $email_text_body_tpl = replace_macros($tpl,array( '$siteName' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site '$thumb' => $importer['thumb'], // thumbnail url for sender icon @@ -222,11 +235,24 @@ function dfrn_notify_post(&$a) { '$from' => $msg['from-name'], // name of the person sending the message '$title' => stripslashes($msg['title']), // subject of the message '$textversion' => $msg['textversion'], // text version of the message - '$htmlversion' => $msg['htmlversion'], // html version of the message '$mimeboundary' => $msg['mimeboundary'], // mime message divider '$hostname' => $a->get_hostname() // name of this host )); + // load the template for private message notifications + $tpl = load_view_file('view/mail_received_eml.tpl'); + + // import the data into the template + $email_tpl = replace_macros($tpl, array( + '$email' => $importer['email'], // email address to send to + '$from' => $msg['from-name'], // name of the person sending the message + '$title' => stripslashes($msg['title']), // subject of the message + '$mimeboundary' => $msg['mimeboundary'], // mime message divider + '$hostname' => $a->get_hostname(), // name of this host + '$htmlbody' => chunk_split(base64_encode($email_html_body_tpl)), + '$textbody' => chunk_split(base64_encode($email_text_body_tpl)) + )); + logger("message headers: " . $msg['headers']); logger("message body: " . $mail_tpl); -- cgit v1.2.3