notification testing

This commit is contained in:
friendica 2011-12-27 14:26:44 -08:00
parent 5c7df6e964
commit 0f87f84cfb
3 changed files with 10 additions and 10 deletions

View file

@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php'); require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1207' ); define ( 'FRIENDICA_VERSION', '2.3.1208' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1112 ); define ( 'DB_UPDATE_VERSION', 1112 );

View file

@ -2,7 +2,7 @@
function notification($params) { function notification($params) {
logger('notification: entry'); logger('notification: entry', LOGGER_DEBUG);
$a = get_app(); $a = get_app();
$banner = t('Friendica Notification'); $banner = t('Friendica Notification');
@ -12,10 +12,10 @@ function notification($params) {
$sitename = get_config('config','sitename'); $sitename = get_config('config','sitename');
$site_admin = sprintf( t('%s Administrator'), $sitename); $site_admin = sprintf( t('%s Administrator'), $sitename);
$sender_name = t('Administrator'); $sender_name = $product;
$sender_email = t('noreply') . '@' . $a->get_hostname(); $sender_email = t('noreply') . '@' . $a->get_hostname();
if(in_array('item',$params)) { if(array_key_exists('item',$params)) {
$title = $params['item']['title']; $title = $params['item']['title'];
$body = $params['item']['body']; $body = $params['item']['body'];
} }
@ -78,7 +78,7 @@ function notification($params) {
require_once('bbcode.php'); require_once('bbcode.php');
if(intval($params['notify_flags']) & intval($params['type'])) { if(intval($params['notify_flags']) & intval($params['type'])) {
logger('notification: sending email'); logger('notification: sending notification email');
push_lang($params['language']); push_lang($params['language']);
@ -100,7 +100,7 @@ function notification($params) {
'$source_photo' => $params['source_photo'], '$source_photo' => $params['source_photo'],
'$username' => $params['to_name'], '$username' => $params['to_name'],
'$hsitelink' => $hsitelink, '$hsitelink' => $hsitelink,
'$itemlink' => $itemlink, '$itemlink' => '<a href="' . $itemlink . '">' . $itemlink . '</a>',
'$thanks' => $thanks, '$thanks' => $thanks,
'$site_admin' => $site_admin, '$site_admin' => $site_admin,
'$title' => stripslashes($title), '$title' => stripslashes($title),
@ -127,7 +127,7 @@ function notification($params) {
'$textversion' => $textversion, '$textversion' => $textversion,
)); ));
logger('text: ' . $email_text_body); // logger('text: ' . $email_text_body);
// use the EmailNotification library to send the message // use the EmailNotification library to send the message
@ -172,7 +172,7 @@ class enotify {
// generate a multipart/alternative message header // generate a multipart/alternative message header
$messageHeader = $messageHeader =
"From: {$params['fromName']} <{$params['fromEmail']}>\n" . "From: {$params['fromName']} <{$params['fromEmail']}>\n" .
"Reply-To: {$params['replyTo']}\n" . "Reply-To: {$params['fromName']} <{$params['replyTo']}>\n" .
"MIME-Version: 1.0\n" . "MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\""; "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
@ -197,7 +197,7 @@ class enotify {
$multipartMessageBody, // message body $multipartMessageBody, // message body
$messageHeader // message headers $messageHeader // message headers
); );
logger("enotify::send returns " . $res, LOGGER_DEBUG); logger("notification: enotify::send returns " . $res, LOGGER_DEBUG);
} }
} }
?> ?>

View file

@ -16,6 +16,7 @@
*/ */
require_once('include/crypto.php'); require_once('include/crypto.php');
require_once('include/enotify.php');
function item_post(&$a) { function item_post(&$a) {
@ -680,7 +681,6 @@ function item_post(&$a) {
); );
if($contact_record != $author) { if($contact_record != $author) {
require_once('include/enotify.php');
notification(array( notification(array(
'type' => NOTIFY_COMMENT, 'type' => NOTIFY_COMMENT,
'notify_flags' => $user['notify-flags'], 'notify_flags' => $user['notify-flags'],