]> git.mxchange.org Git - friendica.git/commitdiff
Cleanup enotify email
authornupplaPhil <admin+github@philipp.info>
Sat, 1 Feb 2020 08:52:08 +0000 (09:52 +0100)
committernupplaPhil <admin+github@philipp.info>
Sun, 2 Feb 2020 21:43:34 +0000 (22:43 +0100)
- Removing unused fields
- Move notify template to email subdirectory

include/enotify.php
view/templates/email/notify_html.tpl [new file with mode: 0644]
view/templates/email/notify_text.tpl [new file with mode: 0644]
view/templates/email_notify_html.tpl [deleted file]
view/templates/email_notify_text.tpl [deleted file]

index e21adc91ac64fe07dbcfc2e2aad7f6166f34dc56..b90f96d5aa1d238b41da1a4bd7c328c649f5697d 100644 (file)
@@ -548,7 +548,6 @@ function notification($params)
                $datarray['source_link']  = $params['source_link'] ?? '';
                $datarray['source_photo'] = $params['source_photo'] ?? '';
                $datarray['uid']          = $params['uid'];
-               $datarray['username']     = $params['to_name'] ?? '';
                $datarray['hsitelink']    = $hsitelink;
                $datarray['tsitelink']    = $tsitelink;
                $datarray['hitemlink']    = '<a href="' . $itemlink . '">' . $itemlink . '</a>';
@@ -568,7 +567,7 @@ function notification($params)
                $content_allowed = ((!DI::config()->get('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
 
                // load the template for private message notifications
-               $tpl             = Renderer::getMarkupTemplate('email_notify_html.tpl');
+               $tpl             = Renderer::getMarkupTemplate('email/notify_html.tpl');
                $email_html_body = Renderer::replaceMacros($tpl, [
                        '$banner'          => $datarray['banner'],
                        '$product'         => $datarray['product'],
@@ -578,7 +577,6 @@ function notification($params)
                        '$source_name'     => $datarray['source_name'],
                        '$source_link'     => $datarray['source_link'],
                        '$source_photo'    => $datarray['source_photo'],
-                       '$username'        => $datarray['username'],
                        '$hsitelink'       => $datarray['hsitelink'],
                        '$hitemlink'       => $datarray['hitemlink'],
                        '$thanks'          => $datarray['thanks'],
@@ -589,17 +587,9 @@ function notification($params)
                ]);
 
                // load the template for private message notifications
-               $tpl             = Renderer::getMarkupTemplate('email_notify_text.tpl');
+               $tpl             = Renderer::getMarkupTemplate('email/notify_text.tpl');
                $email_text_body = Renderer::replaceMacros($tpl, [
-                       '$banner'          => $datarray['banner'],
-                       '$product'         => $datarray['product'],
                        '$preamble'        => $datarray['preamble'],
-                       '$sitename'        => $datarray['sitename'],
-                       '$siteurl'         => $datarray['siteurl'],
-                       '$source_name'     => $datarray['source_name'],
-                       '$source_link'     => $datarray['source_link'],
-                       '$source_photo'    => $datarray['source_photo'],
-                       '$username'        => $datarray['username'],
                        '$tsitelink'       => $datarray['tsitelink'],
                        '$titemlink'       => $datarray['titemlink'],
                        '$thanks'          => $datarray['thanks'],
diff --git a/view/templates/email/notify_html.tpl b/view/templates/email/notify_html.tpl
new file mode 100644 (file)
index 0000000..d9eeb84
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN">
+<html>
+<head>
+       <title>{{$banner}}</title>
+       <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+</head>
+<body>
+       <table style="border:1px solid #ccc">
+       <tbody>
+               <tr>
+                       <td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;">
+                               <img style="width:32px;height:32px; float:left;" src='{{$siteurl}}/images/friendica-32.png'>
+                               <div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div>
+                               <div style="clear: both;"></div>
+                       </td>
+               </tr>
+
+               <tr><td colspan="2" style="padding-top:22px;">{{$preamble nofilter}}</td></tr>
+
+{{if $content_allowed}}
+       {{if $source_photo}}
+               <tr>
+                       <td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="{{$source_link}}"><img style="border:0px;width:48px;height:48px;" src="{{$source_photo}}"></a></td>
+                       <td style="padding-top:22px;"><a href="{{$source_link}}">{{$source_name}}</a></td>
+               </tr>
+               {{/if}}
+               <tr><td style="font-weight:bold;padding-bottom:5px;">{{$title}}</td></tr>
+               <tr><td style="padding-right:22px;">{{$htmlversion nofilter}}</td></tr>
+{{/if}}
+               <tr><td colspan="2" style="padding-top:11px;">{{$hsitelink nofilter}}</td></tr>
+               <tr><td colspan="2" style="padding-bottom:11px;">{{$hitemlink nofilter}}</td></tr>
+               <tr><td></td><td>{{$thanks}}</td></tr>
+               <tr><td></td><td>{{$site_admin}}</td></tr>
+       </tbody>
+       </table>
+</body>
+</html>
diff --git a/view/templates/email/notify_text.tpl b/view/templates/email/notify_text.tpl
new file mode 100644 (file)
index 0000000..28b644d
--- /dev/null
@@ -0,0 +1,14 @@
+
+{{$preamble nofilter}}
+
+{{if $content_allowed}}
+{{$title nofilter}}
+
+{{$textversion nofilter}}
+
+{{/if}}
+{{$tsitelink nofilter}}
+{{$titemlink nofilter}}
+
+{{$thanks nofilter}}
+{{$site_admin nofilter}}
diff --git a/view/templates/email_notify_html.tpl b/view/templates/email_notify_html.tpl
deleted file mode 100644 (file)
index d9eeb84..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN">
-<html>
-<head>
-       <title>{{$banner}}</title>
-       <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-</head>
-<body>
-       <table style="border:1px solid #ccc">
-       <tbody>
-               <tr>
-                       <td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;">
-                               <img style="width:32px;height:32px; float:left;" src='{{$siteurl}}/images/friendica-32.png'>
-                               <div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div>
-                               <div style="clear: both;"></div>
-                       </td>
-               </tr>
-
-               <tr><td colspan="2" style="padding-top:22px;">{{$preamble nofilter}}</td></tr>
-
-{{if $content_allowed}}
-       {{if $source_photo}}
-               <tr>
-                       <td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="{{$source_link}}"><img style="border:0px;width:48px;height:48px;" src="{{$source_photo}}"></a></td>
-                       <td style="padding-top:22px;"><a href="{{$source_link}}">{{$source_name}}</a></td>
-               </tr>
-               {{/if}}
-               <tr><td style="font-weight:bold;padding-bottom:5px;">{{$title}}</td></tr>
-               <tr><td style="padding-right:22px;">{{$htmlversion nofilter}}</td></tr>
-{{/if}}
-               <tr><td colspan="2" style="padding-top:11px;">{{$hsitelink nofilter}}</td></tr>
-               <tr><td colspan="2" style="padding-bottom:11px;">{{$hitemlink nofilter}}</td></tr>
-               <tr><td></td><td>{{$thanks}}</td></tr>
-               <tr><td></td><td>{{$site_admin}}</td></tr>
-       </tbody>
-       </table>
-</body>
-</html>
diff --git a/view/templates/email_notify_text.tpl b/view/templates/email_notify_text.tpl
deleted file mode 100644 (file)
index 28b644d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-{{$preamble nofilter}}
-
-{{if $content_allowed}}
-{{$title nofilter}}
-
-{{$textversion nofilter}}
-
-{{/if}}
-{{$tsitelink nofilter}}
-{{$titemlink nofilter}}
-
-{{$thanks nofilter}}
-{{$site_admin nofilter}}