aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-17 14:05:51 -0800
committerFriendika <info@friendika.com>2011-02-17 14:05:51 -0800
commit0bf8e418a8b8c57607ed8a52cff6b3ac53d38d05 (patch)
tree26a8df206e8fbd8f91fd33afb8b62a5c67f72386
parent45bd7d5e290957a6af38cd44a32033938b8ccdb0 (diff)
parent9e654f7e5777458941e93b4bfa6de2a11d4374f9 (diff)
downloadvolse-hubzilla-0bf8e418a8b8c57607ed8a52cff6b3ac53d38d05.tar.gz
volse-hubzilla-0bf8e418a8b8c57607ed8a52cff6b3ac53d38d05.tar.bz2
volse-hubzilla-0bf8e418a8b8c57607ed8a52cff6b3ac53d38d05.zip
Merge branch 'chriscase-master'
Conflicts: mod/dfrn_notify.php
-rw-r--r--mod/dfrn_notify.php34
-rw-r--r--view/de/mail_received_eml.tpl13
-rw-r--r--view/en/mail_received_eml.tpl14
-rw-r--r--view/fr/mail_received_eml.tpl13
-rw-r--r--view/it/mail_received_eml.tpl13
5 files changed, 15 insertions, 72 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index b8d86ad24..180a8edfd 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -238,31 +238,27 @@ 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(
- '$siteurl' => $a->get_baseurl(), // descriptive url of this site
- '$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);
+
+ // 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
// send the message
$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
);
}
diff --git a/view/de/mail_received_eml.tpl b/view/de/mail_received_eml.tpl
deleted file mode 100644
index 6ddd586fc..000000000
--- a/view/de/mail_received_eml.tpl
+++ /dev/null
@@ -1,13 +0,0 @@
---$mimeboundary
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$textbody
-
---$mimeboundary
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$htmlbody
-
---$mimeboundary-- \ No newline at end of file
diff --git a/view/en/mail_received_eml.tpl b/view/en/mail_received_eml.tpl
deleted file mode 100644
index 99eb14391..000000000
--- a/view/en/mail_received_eml.tpl
+++ /dev/null
@@ -1,14 +0,0 @@
---$mimeboundary
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$textbody
-
---$mimeboundary
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$htmlbody
-
---$mimeboundary--
-
diff --git a/view/fr/mail_received_eml.tpl b/view/fr/mail_received_eml.tpl
deleted file mode 100644
index 6ddd586fc..000000000
--- a/view/fr/mail_received_eml.tpl
+++ /dev/null
@@ -1,13 +0,0 @@
---$mimeboundary
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$textbody
-
---$mimeboundary
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$htmlbody
-
---$mimeboundary-- \ No newline at end of file
diff --git a/view/it/mail_received_eml.tpl b/view/it/mail_received_eml.tpl
deleted file mode 100644
index 538d28e1e..000000000
--- a/view/it/mail_received_eml.tpl
+++ /dev/null
@@ -1,13 +0,0 @@
---$mimeboundary
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$textbody
-
---$mimeboundary
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-$htmlbody
-
---$mimeboundary--