aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-06 14:40:19 -0700
committerFriendika <info@friendika.com>2010-11-06 14:40:19 -0700
commit05236adf0f1dd821c14ae0ffed2aaa08b9c606a2 (patch)
treedd45b42e0ab5850f4981b08c10e72da4381060e8 /include/items.php
parent964ca0e07995de67c65c7916e1c8ce9706edb9da (diff)
downloadvolse-hubzilla-05236adf0f1dd821c14ae0ffed2aaa08b9c606a2.tar.gz
volse-hubzilla-05236adf0f1dd821c14ae0ffed2aaa08b9c606a2.tar.bz2
volse-hubzilla-05236adf0f1dd821c14ae0ffed2aaa08b9c606a2.zip
notification email on follow activities
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 323117e6c..133d1299b 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1045,6 +1045,26 @@ function new_follower($importer,$contact,$datarray,$item) {
dbesc(datetime_convert())
);
}
+ $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
+ intval($importer['uid'])
+ );
+ if(count($r)) {
+ if(($r[0]['notify-flags'] & NOTIFY_INTRO) && ($r[0]['page-flags'] == PAGE_NORMAL)) {
+ $email_tpl = load_view_file('view/follow_notify_eml.tpl');
+ $email = replace_macros($email_tpl, array(
+ '$requestor' => ((strlen($name)) ? $name : t('[Name Withheld]')),
+ '$url' => $url,
+ '$myname' => $r[0]['username'],
+ '$siteurl' => $a->get_baseurl(),
+ '$sitename' => $a->config['sitename']
+ ));
+ $res = mail($r[0]['email'],
+ t("You have a new follower at ") . $a->config['sitename'],
+ $email,
+ 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME] );
+
+ }
+ }
}
}