From 75e61e2d2e7b43696b72fe418b0020234bdd38cc Mon Sep 17 00:00:00 2001 From: Sendya <18x@loacg.com> Date: Wed, 1 Jun 2016 14:22:30 +0800 Subject: [PATCH] Add : message/mail placeholder --- Library/Controller/Admin/Mailer.php | 10 +++++++++- Template/Default/admin/message.htm | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/Controller/Admin/Mailer.php b/Library/Controller/Admin/Mailer.php index f23686fb..29b5521f 100644 --- a/Library/Controller/Admin/Mailer.php +++ b/Library/Controller/Admin/Mailer.php @@ -11,6 +11,7 @@ use Core\Template; use Helper\Option; +use Helper\Utils; use Model\Mail; use Model\User; use Helper\Mailer as Mailer1; @@ -94,8 +95,15 @@ public function postAll() foreach ($users as $user) { $mail = new Mail(); + $params = [ + 'nickname' => $user->nickname, + 'email' => $user->email, + 'useTraffic' => Utils::flowAutoShow($user->flow_up + $user->flow_down), + 'transfer' => Utils::flowAutoShow($user->transfer), + 'expireTime' => date('Y-m-d H:i:s', $user->expireTime), + ]; $mail->subject = $subject; - $mail->content = $content; + $mail->content = Utils::placeholderReplace($content, $params); $mail->to = $user->email; $mailer->send($mail); } diff --git a/Template/Default/admin/message.htm b/Template/Default/admin/message.htm index 26171aff..854f6e1e 100644 --- a/Template/Default/admin/message.htm +++ b/Template/Default/admin/message.htm @@ -267,6 +267,7 @@
newHtml += ''; newHtml += '
支持消息内容标记:{SITE_NAME} : 站点名称,{nickname} : 当前用户名称,{email} : 用户电子邮件,{useTraffic}: 已用流量,{transfer} : 总流量,{expireTime}: 到期时间