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}: 到期时间