diff options
-rw-r--r-- | boot.php | 1 | ||||
-rw-r--r-- | mod/dfrn_notify.php | 13 | ||||
-rw-r--r-- | view/mail_received_eml.tpl | 6 |
3 files changed, 9 insertions, 11 deletions
@@ -97,6 +97,7 @@ class App { function set_baseurl($url) { $this->baseurl = $url; + $this->hostname = basename($url); } function get_hostname() { diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 7b73344d6..057dfcb42 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -68,6 +68,7 @@ function dfrn_notify_post(&$a) { $msg['parent-uri'] = notags(unxmlify($base['in-reply-to'][0]['data'])); $msg['created'] = datetime_convert(notags(unxmlify('UTC','UTC',$base['sentdate'][0]['data']))); + $r = q("INSERT INTO `mail` (`" . implode("`, `", array_keys($msg)) . "`) VALUES ('" . implode("', '", array_values($msg)) . "')" ); @@ -76,7 +77,7 @@ function dfrn_notify_post(&$a) { intval($importer['uid']) ); require_once('bbcode.php'); - if((count($r)) && ($r[0]['notify_flags'] & NOTIFY_MAIL)) { + if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_MAIL)) { $tpl = file_get_contents('view/mail_received_eml.tpl'); $email_tpl = replace_macros($tpl, array( '$sitename' => $a->config['sitename'], @@ -88,16 +89,12 @@ function dfrn_notify_post(&$a) { '$title' => $msg['title'], '$body' => strip_tags(bbcode($msg['body'])) )); - + $res = mail($r[0]['email'], t("New mail received at ") . $a->config['sitename'], - $email_tpl,t("From: Administrator@") . $_SERVER[SERVER_NAME] ); - if(!$res) { - notice( t("Email notification failed.") . EOL ); - } + $email_tpl,t("From: Administrator@") . $a->get_hostname() ); } - xml_status(0); - return; + return; // NOTREACHED } foreach($feed->get_items() as $item) { diff --git a/view/mail_received_eml.tpl b/view/mail_received_eml.tpl index a9abdc371..261aec4be 100644 --- a/view/mail_received_eml.tpl +++ b/view/mail_received_eml.tpl @@ -2,11 +2,11 @@ Dear $username, You've received a new private message at $sitename from '$from'. - +----- $title - +----- $body - +----- Please login at $siteurl to read and reply to your private messages. Thank you, |