From bef8f95ef3e638cb843810ed68cd9617e6e2cc48 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 24 Dec 2011 22:36:17 -0800 Subject: [PATCH] more enotify --- include/enotify.php | 19 +++++++++---------- view/email_notify_html.tpl | 26 ++++++++++++++++++++++++++ view/email_notify_text.tpl | 11 +++++++++++ 3 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 view/email_notify_html.tpl create mode 100644 view/email_notify_text.tpl diff --git a/include/enotify.php b/include/enotify.php index 5febe411..cf0788e6 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -38,10 +38,10 @@ function notification($params) { $subject = sprintf( t('New mail received at %s'),$sitename); - $new_email = sprintf( t('%s sent you a new private message at %s.'),$params['source_name'],$sitename); - $email_visit = t('Please visit %s to view and/or reply to your private messages.'); - $email_tlink = sprintf( $email_visit, $siteurl . '/message' ); - $email_hlink = sprintf( $email_visit, '' . $sitename . ''); + $preamble = sprintf( t('%s sent you a new private message at %s.'),$params['source_name'],$sitename); + $sitelink = t('Please visit %s to view and/or reply to your private messages.'); + $tsitelink = sprintf( $email_visit, $siteurl . '/message' ); + $hsitelink = sprintf( $email_visit, '' . $sitename . ''); } @@ -53,14 +53,13 @@ function notification($params) { push_lang($params['language']); - $msg['notificationfromname'] = $sender_name; - $msg['notificationfromemail'] = $sender_email; + $msg = array(); + $msg['fromname'] = $sender_name; + $msg['fromemail'] = $sender_email; - $msg['textversion'] - = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n", + $msg['textversion'] = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n", $body))),ENT_QUOTES,'UTF-8')); - $msg['htmlversion'] - = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), + $msg['htmlversion'] = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "
\n",$body)))); // load the template for private message notifications diff --git a/view/email_notify_html.tpl b/view/email_notify_html.tpl new file mode 100644 index 00000000..f020b736 --- /dev/null +++ b/view/email_notify_html.tpl @@ -0,0 +1,26 @@ + + + + $banner + + + + + + + + + + + + + + + + + + + +
Friendica
$preamble
$from
$title
$htmlversion
$hsitelink
$thanks
$sit_admin
+ + diff --git a/view/email_notify_text.tpl b/view/email_notify_text.tpl new file mode 100644 index 00000000..450adc1d --- /dev/null +++ b/view/email_notify_text.tpl @@ -0,0 +1,11 @@ +$preamble + +$title + +$textversion + +$tsitelink + +$thanks +$site_admin +