]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
Generate preview pictures from enclosed data from feeds.
[friendica.git] / include / enotify.php
index 54db6912cb8cf5e73dda906b34be196a85d1ec88..51263871b6aad1d4d5d8716ed65a3c1d34f0d304 100644 (file)
@@ -312,7 +312,7 @@ function notification($params) {
                        case "SYSTEM_REGISTER_REQUEST":
                                $subject = sprintf( t('[Friendica System:Notify] registration request'));
                                $preamble = sprintf( t('You\'ve received a registration request from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
-                               $epreamble = sprintf( t('You\'ve received a registration request [url=%1$s]an introduction[/url] from %2$s.'),
+                               $epreamble = sprintf( t('You\'ve received a [url=%1$s]registration request[/url] from %2$s.'),
                                                                                $itemlink,
                                                                                '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]');
                                $body = sprintf( t('Full Name:  %1$s\nSite Location:    %2$s\nLogin Name:       %3$s (%4$s)'),
@@ -320,7 +320,7 @@ function notification($params) {
 
                                $sitelink = t('Please visit %s to approve or reject the request.');
                                $tsitelink = sprintf( $sitelink, $params['link'] );
-                               $hsitelink = sprintf( $sitelink, '<a href="' . $params['link'] . '">' . $sitename . '</a>');
+                               $hsitelink = sprintf( $sitelink, '<a href="' . $params['link'] . '">' . $sitename . '</a><br><br>');
                                $itemlink =  $params['link'];
                                break;
                        case "SYSTEM_DB_UPDATE_FAIL":
@@ -336,11 +336,6 @@ function notification($params) {
                // add a notification to the user, with could be inexistent)
                        $subject = $params['subject'];
                        $preamble = $params['preamble'];
-                       if (x($params,'epreamble')){
-                               $epreamble = $params['epreamble'];
-                       } else {
-                               $epreamble = str_replace("\n","<br>\n",$preamble);
-                       }
                        $body =  $params['body'];
                        $sitelink = "";
                        $tsitelink = "";
@@ -547,14 +542,15 @@ function notification($params) {
                call_hooks('enotify_mail', $datarray);
 
                // check whether sending post content in email notifications is allowed
-               $content_allowed = !get_config('system','enotify_no_content');
+               // always true for "SYSTEM_EMAIL"
+               $content_allowed = ((!get_config('system','enotify_no_content')) || ($params['type'] == "SYSTEM_EMAIL"));
 
                // load the template for private message notifications
                $tpl = get_markup_template('email_notify_html.tpl');
                $email_html_body = replace_macros($tpl,array(
                        '$banner'       => $datarray['banner'],
                        '$product'      => $datarray['product'],
-                       '$preamble'     => $datarray['preamble'],
+                       '$preamble'     => str_replace("\n","<br>\n",$datarray['preamble']),
                        '$sitename'     => $datarray['sitename'],
                        '$siteurl'      => $datarray['siteurl'],
                        '$source_name'  => $datarray['source_name'],
@@ -595,7 +591,7 @@ function notification($params) {
 
                // use the Emailer class to send the message
 
-               Emailer::send(array(
+               return Emailer::send(array(
                        'fromName' => $sender_name,
                        'fromEmail' => $sender_email,
                        'replyTo' => $sender_email,
@@ -605,7 +601,6 @@ function notification($params) {
                        'textVersion' => $email_text_body,
                        'additionalMailHeader' => $datarray['headers'],
                ));
-        return True;
        }
 
     return False;