Skip to content

Commit

Permalink
Add : message/mail placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Jun 1, 2016
1 parent f1184be commit 75e61e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Library/Controller/Admin/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Core\Template;
use Helper\Option;
use Helper\Utils;
use Model\Mail;
use Model\User;
use Helper\Mailer as Mailer1;
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions Template/Default/admin/message.htm
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ <h4 class="modal-title"></h4>
newHtml += '<input class="form-control autogrow" name="mailer.subject" id="field-0" /></div>';
newHtml += '<div class="form-group no-margin"><label for="field-1" class="control-label">消息内容</label>';
newHtml += '<textarea class="form-control autogrow" name="mailer.content" rows="15" id="field-0" placeholder="请填写消息内容,支持 HTML 标记"></textarea>';
newHtml += '<p><br/>支持消息内容标记:{SITE_NAME} : 站点名称,{nickname} : 当前用户名称,{email} : 用户电子邮件,{useTraffic}: 已用流量,{transfer} : 总流量,{expireTime}: 到期时间</p>';
newHtml += '</div></div>';
$("#form1").attr("action", "admin/mailer/postAll.json");
$("#modal-6 .modal-body").html(newHtml);
Expand Down

0 comments on commit 75e61e2

Please sign in to comment.