aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorChris Case <kahotep@bunda.dreamhost.com>2011-02-16 08:05:10 -0800
committerChris Case <kahotep@bunda.dreamhost.com>2011-02-16 08:05:10 -0800
commit21693295474f5acaa21526ae05fa80a731eb1a6a (patch)
treed7157a6a915a8c81645925692236ff8e615e3822 /mod
parente56895123aea566cd7a3fbe3acf522bcb34bc0b2 (diff)
downloadvolse-hubzilla-21693295474f5acaa21526ae05fa80a731eb1a6a.tar.gz
volse-hubzilla-21693295474f5acaa21526ae05fa80a731eb1a6a.tar.bz2
volse-hubzilla-21693295474f5acaa21526ae05fa80a731eb1a6a.zip
forgot to check this in earlier... splits up text and html into two different templates and base64 encodes them
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_notify.php34
1 files changed, 30 insertions, 4 deletions
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"), "<br />\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);