Merge branch 'chriscase-master'
Conflicts: mod/dfrn_notify.php
This commit is contained in:
commit
0bf8e418a8
5 changed files with 15 additions and 72 deletions
|
@ -239,30 +239,26 @@ function dfrn_notify_post(&$a) {
|
||||||
'$hostname' => $a->get_hostname() // name of this host
|
'$hostname' => $a->get_hostname() // name of this host
|
||||||
));
|
));
|
||||||
|
|
||||||
// load the template for private message notifications
|
// assemble the final multipart message body with the text and html types included
|
||||||
$tpl = load_view_file('view/mail_received_eml.tpl');
|
$textbody = chunk_split(base64_encode($email_text_body_tpl));
|
||||||
|
$htmlbody = chunk_split(base64_encode($email_html_body_tpl));
|
||||||
// import the data into the template
|
$multipart_message_body =
|
||||||
$email_tpl = replace_macros($tpl, array(
|
"--" . $msg['mimeboundary'] . "\n" . // plain text section
|
||||||
'$siteurl' => $a->get_baseurl(), // descriptive url of this site
|
"Content-Type: text/plain; charset=UTF-8\n" .
|
||||||
'$email' => $importer['email'], // email address to send to
|
"Content-Transfer-Encoding: base64\n\n" .
|
||||||
'$from' => $msg['from-name'], // name of the person sending the message
|
$textbody . "\n" .
|
||||||
'$title' => stripslashes($msg['title']), // subject of the message
|
"--" . $msg['mimeboundary'] . "\n" . // text/html section
|
||||||
'$mimeboundary' => $msg['mimeboundary'], // mime message divider
|
"Content-Type: text/html; charset=UTF-8\n" .
|
||||||
'$hostname' => $a->get_hostname(), // name of this host
|
"Content-Transfer-Encoding: base64\n\n" .
|
||||||
'$htmlbody' => chunk_split(base64_encode($email_html_body_tpl)),
|
$htmlbody . "\n" .
|
||||||
'$textbody' => chunk_split(base64_encode($email_text_body_tpl))
|
"--" . $msg['mimeboundary'] . "--\n"; // message ending
|
||||||
));
|
|
||||||
|
|
||||||
logger("message headers: " . $msg['headers']);
|
|
||||||
logger("message body: " . $mail_tpl);
|
|
||||||
|
|
||||||
|
|
||||||
// send the message
|
// send the message
|
||||||
$res = mail(
|
$res = mail(
|
||||||
$importer['email'], // send to address
|
$importer['email'], // send to address
|
||||||
t('New mail received at ') . $a->config['sitename'], // subject
|
t('New mail received at ') . $a->config['sitename'], // subject
|
||||||
$email_tpl, // message body
|
$multipart_message_body, // message body
|
||||||
$msg['headers'] // message headers
|
$msg['headers'] // message headers
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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--
|
|
|
@ -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--
|
|
||||||
|
|
|
@ -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--
|
|
|
@ -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--
|
|
Loading…
Reference in a new issue