From 5c7df6e964561ebb5e334865717db03222bf3e1a Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 26 Dec 2011 15:47:40 -0800 Subject: notify_intro --- include/enotify.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'include/enotify.php') 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, '' . $sitename . ''); + $itemlink = $params['link']; + } + + if($params['type'] == NOTIFY_CONFIRM) { + + } + + // TODO - create notification entry in DB + + // send email notification if notification preferences permit -- cgit v1.2.3