]> git.mxchange.org Git - friendica.git/commitdiff
tracking mail notifications
authorMike Macgirvin <mike@macgirvin.com>
Wed, 11 Aug 2010 05:14:17 +0000 (22:14 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Wed, 11 Aug 2010 05:14:17 +0000 (22:14 -0700)
boot.php
mod/dfrn_notify.php
view/mail_received_eml.tpl

index afb907d595e75c17b987386f148cea72a1a7fe97..c99024d0093324552268bdba1ead6cbd9141712e 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -97,6 +97,7 @@ class App {
 
        function set_baseurl($url) {
                $this->baseurl = $url;
+               $this->hostname = basename($url);
        }
 
        function get_hostname() {
index 7b73344d66c5fa403bcf516d4cbb6356e701b01e..057dfcb42297d19a4eff26ffb9d051c1b225ff6c 100644 (file)
@@ -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) {
index a9abdc371c5dd35ba806c8933d613f6abf3bb590..261aec4bedbe6cfb5363bd6488dd2606bc476d9c 100644 (file)
@@ -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,