|
@@ -189,6 +189,9 @@ class Mail extends MessageGateway
|
|
|
$subject = $subject === '' ? mb_substr($content, 0, 12) . '...' : $subject;
|
|
|
$this->phpMailerInstance->Subject = $subject;
|
|
|
|
|
|
+ // 页脚
|
|
|
+ $footer = '';
|
|
|
+
|
|
|
/**
|
|
|
* 正文
|
|
|
* 使用 html 文件内容作为正文,其中的图片将被 base64 编码,另确保 html 样式为内联形式,且某些样式可能需要 !important 方能正常显示,
|
|
@@ -201,22 +204,25 @@ class Mail extends MessageGateway
|
|
|
*/
|
|
|
if ($type === 1) {
|
|
|
$template = file_get_contents($this->noticeTemplatePath);
|
|
|
- $message = sprintf($template, $content);
|
|
|
+ $this->setCommonFooter($footer, '<br>', false);
|
|
|
+ $message = $this->genMessageContent([
|
|
|
+ $content,
|
|
|
+ $footer
|
|
|
+ ], $template);
|
|
|
} else if ($type === 2) {
|
|
|
$template = file_get_contents($this->successfulRenewalTemplatePath);
|
|
|
+ $this->setCommonFooter($footer, '<br>', false);
|
|
|
$realData = [
|
|
|
$data['username'],
|
|
|
$data['renewalSuccessArr'] ? sprintf(lang('100075'), $this->genDomainsHtml($data['renewalSuccessArr'])) : '',
|
|
|
$data['renewalFailuresArr'] ? sprintf(lang('100076'), $this->genDomainsHtml($data['renewalFailuresArr'])) : '',
|
|
|
- $this->genDomainStatusHtml($data['domainStatusArr'])
|
|
|
+ $this->genDomainStatusHtml($data['domainStatusArr']),
|
|
|
+ $footer
|
|
|
];
|
|
|
$message = $this->genMessageContent($realData, $template);
|
|
|
} else if ($type === 3) {
|
|
|
$template = file_get_contents($this->noRenewalRequiredTemplatePath);
|
|
|
-
|
|
|
- $footer = '';
|
|
|
$this->setCommonFooter($footer, '<br>');
|
|
|
-
|
|
|
$realData = [
|
|
|
$data['username'],
|
|
|
$this->genDomainStatusHtml($data['domainStatusArr']),
|
|
@@ -225,7 +231,11 @@ class Mail extends MessageGateway
|
|
|
$message = $this->genMessageContent($realData, $template);
|
|
|
} else if ($type === 4) {
|
|
|
$template = file_get_contents($this->noticeTemplatePath);
|
|
|
- $message = sprintf($template, $this->newLine2Br($content));
|
|
|
+ $this->setCommonFooter($footer, '<br>', false);
|
|
|
+ $message = $this->genMessageContent([
|
|
|
+ $this->newLine2Br($content),
|
|
|
+ $footer
|
|
|
+ ], $template);
|
|
|
} else {
|
|
|
throw new \Exception(lang('100003'));
|
|
|
}
|