aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_notify.php
diff options
context:
space:
mode:
authorChris Case <kahotep@bunda.dreamhost.com>2011-02-17 13:41:56 -0800
committerChris Case <kahotep@bunda.dreamhost.com>2011-02-17 13:41:56 -0800
commit9e654f7e5777458941e93b4bfa6de2a11d4374f9 (patch)
tree481a62e40273a0f7b7e8bbf73c5a2a348d81580e /mod/dfrn_notify.php
parent5aa6bbbbc5a32541c5b9176762aeccf573ba2601 (diff)
downloadvolse-hubzilla-9e654f7e5777458941e93b4bfa6de2a11d4374f9.tar.gz
volse-hubzilla-9e654f7e5777458941e93b4bfa6de2a11d4374f9.tar.bz2
volse-hubzilla-9e654f7e5777458941e93b4bfa6de2a11d4374f9.zip
removed localized multipart email templates, now the multipart settings are configured directly in the code
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r--mod/dfrn_notify.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 040263b0c..9397cfaf9 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -238,20 +238,20 @@ function dfrn_notify_post(&$a) {
'$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))
- ));
+
+ // assemble the final multipart message body with the text and html types included
+ $textbody = chunk_split(base64_encode($email_text_body_tpl));
+ $htmlbody = chunk_split(base64_encode($email_html_body_tpl));
+ $multipart_message_body =
+ "--" . $msg['mimeboundary'] . "\n" . // plain text section
+ "Content-Type: text/plain; charset=UTF-8\n" .
+ "Content-Transfer-Encoding: base64\n\n" .
+ $textbody . "\n" .
+ "--" . $msg['mimeboundary'] . "\n" . // text/html section
+ "Content-Type: text/html; charset=UTF-8\n" .
+ "Content-Transfer-Encoding: base64\n\n" .
+ $htmlbody . "\n" .
+ "--" . $msg['mimeboundary'] . "--\n"; // message ending
logger("message headers: " . $msg['headers']);
logger("message body: " . $mail_tpl);
@@ -261,7 +261,7 @@ function dfrn_notify_post(&$a) {
$res = mail(
$importer['email'], // send to address
t('New mail received at ') . $a->config['sitename'], // subject
- $email_tpl, // message body
+ $multipart_message_body, // message body
$msg['headers'] // message headers
);
}