aboutsummaryrefslogtreecommitdiffstats
path: root/include/enotify.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-26 15:47:40 -0800
committerfriendica <info@friendica.com>2011-12-26 15:47:40 -0800
commit5c7df6e964561ebb5e334865717db03222bf3e1a (patch)
tree7ea8bd49993395208e44fccca11352915ea26f38 /include/enotify.php
parent356c05c6b3f1dbd2b74b73610655218972fd5347 (diff)
downloadvolse-hubzilla-5c7df6e964561ebb5e334865717db03222bf3e1a.tar.gz
volse-hubzilla-5c7df6e964561ebb5e334865717db03222bf3e1a.tar.bz2
volse-hubzilla-5c7df6e964561ebb5e334865717db03222bf3e1a.zip
notify_intro
Diffstat (limited to 'include/enotify.php')
-rw-r--r--include/enotify.php27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/enotify.php b/include/enotify.php
index 6f0d65aed..49a8597b9 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -15,8 +15,13 @@ function notification($params) {
$sender_name = t('Administrator');
$sender_email = t('noreply') . '@' . $a->get_hostname();
- $title = $params['item']['title'];
- $body = $params['item']['body'];
+ if(in_array('item',$params)) {
+ $title = $params['item']['title'];
+ $body = $params['item']['body'];
+ }
+ else {
+ $title = $body = '';
+ }
if($params['type'] == NOTIFY_MAIL) {
@@ -49,6 +54,24 @@ function notification($params) {
$itemlink = $params['link'];
}
+ if($params['type'] == NOTIFY_INTRO) {
+ $subject = sprintf( t('Introduction received at %s'), $sitename);
+ $preamble = sprintf( t('You\'ve received an introduction from \'%s\' at %s'), $params['source_name'], $sitename);
+ $body = sprintf( t('You may visit their profile at %s'),$params['source_link']);
+
+ $sitelink = t('Please visit %s to approve or reject the introduction.');
+ $tsitelink = sprintf( $sitelink, $siteurl );
+ $hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
+ $itemlink = $params['link'];
+ }
+
+ if($params['type'] == NOTIFY_CONFIRM) {
+
+ }
+
+ // TODO - create notification entry in DB
+
+
// send email notification if notification preferences permit