summaryrefslogtreecommitdiff
path: root/plugins/mail
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-03-13 14:40:35 +0300
committerAndrew Dolgov <[email protected]>2020-03-13 14:40:35 +0300
commit1f2a7219054872d3cf968ac385a5f529db4a4333 (patch)
tree2e69281eb99b7c6542567703adf3d9d2b8ef0286 /plugins/mail
parent82326187f9f9265699ac3f3c5fd20015de2616a3 (diff)
allow overriding built-in templates via templates.local
Diffstat (limited to 'plugins/mail')
-rw-r--r--plugins/mail/init.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/mail/init.php b/plugins/mail/init.php
index e85053566..40d147fc9 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -92,18 +92,20 @@ class Mail extends Plugin {
if ($row = $sth->fetch()) {
$user_email = htmlspecialchars($row['email']);
$user_name = htmlspecialchars($row['full_name']);
+ } else {
+ $user_name = "";
+ $user_email = "";
}
- if (!$user_name) $user_name = $_SESSION['name'];
+ if (!$user_name)
+ $user_name = $_SESSION['name'];
print_hidden("from_email", "$user_email");
print_hidden("from_name", "$user_name");
- require_once "lib/MiniTemplator.class.php";
-
- $tpl = new MiniTemplator;
+ $tpl = new Templator();
- $tpl->readTemplateFromFile("templates/email_article_template.txt");
+ $tpl->readTemplateFromFile("email_article_template.txt");
$tpl->setVariable('USER_NAME', $_SESSION["name"], true);
$tpl->setVariable('USER_EMAIL', $user_email, true);
@@ -116,6 +118,8 @@ class Mail extends Plugin {
if (count($ids) > 1) {
$subject = __("[Forwarded]") . " " . __("Multiple articles");
+ } else {
+ $subject = "";
}
while ($line = $sth->fetch()) {