Standardize English email branding
parent
3286342f52
commit
f74037220a
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
final class MailSenderIdentity
|
||||
{
|
||||
private const FALLBACK_NAME = 'Site';
|
||||
private const MAX_DISPLAY_NAME_LENGTH = 128;
|
||||
|
||||
public static function displayName(): string
|
||||
{
|
||||
return self::sanitizeDisplayName(SiteName::defaultName());
|
||||
}
|
||||
|
||||
public static function mailbox($configuredSender): string
|
||||
{
|
||||
$sender = str_replace(["\r", "\n"], '', trim((string) $configuredSender));
|
||||
if (preg_match('/<\s*([^<>]+)\s*>\s*$/D', $sender, $matches) === 1) {
|
||||
$sender = trim($matches[1]);
|
||||
}
|
||||
|
||||
if (filter_var($sender, FILTER_VALIDATE_EMAIL) === false) {
|
||||
throw new InvalidArgumentException('The configured sender must contain a valid email address.');
|
||||
}
|
||||
|
||||
return $sender;
|
||||
}
|
||||
|
||||
public static function header($configuredSender): string
|
||||
{
|
||||
$displayName = addcslashes(self::displayName(), "\\\"");
|
||||
|
||||
return '"' . $displayName . '" <' . self::mailbox($configuredSender) . '>';
|
||||
}
|
||||
|
||||
public static function sanitizeDisplayName($name): string
|
||||
{
|
||||
$name = str_replace(["\r", "\n"], ' ', (string) $name);
|
||||
$name = preg_replace('/[\x00-\x1F\x7F]+/', ' ', $name);
|
||||
$name = preg_replace('/\s+/', ' ', (string) $name);
|
||||
$name = trim((string) $name);
|
||||
|
||||
if ($name === '') {
|
||||
return self::FALLBACK_NAME;
|
||||
}
|
||||
|
||||
if (function_exists('mb_substr')) {
|
||||
return (string) mb_substr($name, 0, self::MAX_DISPLAY_NAME_LENGTH, 'UTF-8');
|
||||
}
|
||||
|
||||
return substr($name, 0, self::MAX_DISPLAY_NAME_LENGTH);
|
||||
}
|
||||
}
|
||||
@ -1,31 +1,29 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}
|
||||
{if $language == 'true'}{if !empty($scene) && $scene == 'login'}Login verification{elseif !empty($scene) && $scene == 'password_change'}Password change verification{elseif !empty($scene) && $scene == 'email_change'}Email change verification{else}Email verification{/if} | {$config["appName"]|escape:"html"}{else}{if !empty($scene) && $scene == 'login'}登录安全验证{elseif !empty($scene) && $scene == 'password_change'}修改密码验证{elseif !empty($scene) && $scene == 'email_change'}修改邮箱验证{else}注册邮箱验证{/if} | {$config["appName"]|escape:"html"}{/if}
|
||||
{/block}
|
||||
{block name='preheader'}{if $language == 'true'}Your verification code is {$code|escape:"html"}.{else}您的验证码是 {$code|escape:"html"}。{/if}{/block}
|
||||
{block name='email_title'}{if !empty($scene) && $scene == 'login'}Login verification{elseif !empty($scene) && $scene == 'password_change'}Password change verification{elseif !empty($scene) && $scene == 'email_change'}Email change verification{else}Email verification{/if}{/block}
|
||||
{block name='preheader'}Your verification code is {$code|escape:"html"}.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 10px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.8px; text-transform:uppercase;">{if !empty($scene) && $scene == 'login'}ACCOUNT SECURITY{elseif !empty($scene) && $scene == 'registration'}WELCOME TO THE CLOUD{elseif !empty($scene) && ($scene == 'password_change' || $scene == 'email_change')}ACCOUNT SECURITY{else}EMAIL VERIFICATION{/if}</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">
|
||||
{if $language == 'true'}{if !empty($scene) && $scene == 'login'}Confirm your sign-in{elseif !empty($scene) && $scene == 'password_change'}Confirm your password change{elseif !empty($scene) && $scene == 'email_change'}Confirm your email change{else}Verify your email address{/if}{else}{if !empty($scene) && $scene == 'login'}确认本次登录{elseif !empty($scene) && $scene == 'password_change'}确认修改密码{elseif !empty($scene) && $scene == 'email_change'}确认修改邮箱{else}验证您的注册邮箱{/if}{/if}
|
||||
{if !empty($scene) && $scene == 'login'}Confirm your sign-in{elseif !empty($scene) && $scene == 'password_change'}Confirm your password change{elseif !empty($scene) && $scene == 'email_change'}Confirm your email change{else}Verify your email address{/if}
|
||||
</h1>
|
||||
<p class="email-copy" style="margin:0 0 24px; color:#53647a; font-size:15px; line-height:25px;">
|
||||
{if $language == 'true'}{if !empty($scene) && $scene == 'login'}Enter the code below to complete the security check for your sign-in.{elseif !empty($scene) && $scene == 'password_change'}Enter the code below on the account page to confirm your password change.{elseif !empty($scene) && $scene == 'email_change'}Enter the code below in account settings to verify this new email address before using it to sign in.{else}Enter the code below on the registration page to finish creating your account.{/if}{else}{if !empty($scene) && $scene == 'login'}请在登录页面输入下方验证码,完成本次安全验证。{elseif !empty($scene) && $scene == 'password_change'}请在账户设置页面输入下方验证码,确认修改密码。{elseif !empty($scene) && $scene == 'email_change'}请在账户设置中输入下方验证码,验证此新邮箱后再将其设为登录邮箱。{else}请在注册页面输入下方验证码,完成邮箱验证并继续创建账户。{/if}{/if}
|
||||
{if !empty($scene) && $scene == 'login'}Enter the code below to complete the security check for your sign-in.{elseif !empty($scene) && $scene == 'password_change'}Enter the code below on the account page to confirm your password change.{elseif !empty($scene) && $scene == 'email_change'}Enter the code below in account settings to verify this new email address before using it to sign in.{else}Enter the code below on the registration page to finish creating your account.{/if}
|
||||
</p>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;">
|
||||
<tr><td class="email-panel" align="center" bgcolor="#eaf8f8" style="padding:22px 16px; background-color:#eaf8f8; border-radius:12px; text-align:center;">
|
||||
<span style="display:block; margin:0 0 7px; color:#708396; font-size:11px; line-height:16px; font-weight:700;">{if $language == 'true'}VERIFICATION CODE{else}邮箱验证码{/if}</span>
|
||||
<span style="display:block; margin:0 0 7px; color:#708396; font-size:11px; line-height:16px; font-weight:700;">VERIFICATION CODE</span>
|
||||
<strong class="email-code" style="display:block; color:#0f8f9a; font-family:'SFMono-Regular',Consolas,'Liberation Mono',monospace; font-size:32px; line-height:40px; font-weight:800; letter-spacing:7px;">{$code|escape:"html"}</strong>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 20px;">
|
||||
<tr><td class="email-panel" bgcolor="#f2f6f9" style="padding:14px 16px; background-color:#f2f6f9; border-radius:9px; color:#53647a; font-size:12px; line-height:20px;">
|
||||
{if $language == 'true'}This code is valid until <strong style="color:#34445a;">{$expire|escape:"html"}</strong>.{else}本验证码将在 <strong style="color:#34445a;">{$expire|escape:"html"}</strong> 失效。{/if}
|
||||
This code is valid until <strong style="color:#34445a;">{$expire|escape:"html"}</strong>.
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:21px;">{if $language == 'true'}Never share this code with anyone. If you did not request it, you can safely ignore this email.{else}请勿向任何人泄露此验证码。如果并非您本人操作,可以安全地忽略此邮件。{/if}</p>
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:21px;">Never share this code with anyone. If you did not request it, you can safely ignore this email.</p>
|
||||
{/block}
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}续费账单已生成 | {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}实例 {$instance_name|escape:"html"} 的续费账单已生成,最晚可在 {$payment_deadline_at|escape:"html"} 前支付。{/block}
|
||||
{block name='email_title'}Renewal invoice created{/block}
|
||||
{block name='preheader'}The renewal invoice for {$instance_name|escape:"html"} is ready. Payment is available until {$payment_deadline_at|escape:"html"}.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 10px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.8px;">SERVICE RENEWAL</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">续费账单已生成</h1>
|
||||
<p class="email-copy" style="margin:0 0 23px; color:#53647a; font-size:15px; line-height:25px;">您的云服务器 <strong style="color:#34445a;">{$instance_name|escape:"html"}</strong> 将于 {$due_at|escape:"html"} 到期。到期后网络会暂停,您仍可在 <strong style="color:#34445a;">{$payment_deadline_at|escape:"html"}</strong> 前完成续费。</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">Renewal invoice created</h1>
|
||||
<p class="email-copy" style="margin:0 0 23px; color:#53647a; font-size:15px; line-height:25px;">Your cloud server <strong style="color:#34445a;">{$instance_name|escape:"html"}</strong> expires at {$due_at|escape:"html"}. Network access will be suspended after expiry, but you can still renew it before <strong style="color:#34445a;">{$payment_deadline_at|escape:"html"}</strong>.</p>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="width:100%; margin:0 0 22px; background-color:#f2f6f9; border-radius:12px;">
|
||||
<tr>
|
||||
<td class="email-fact-cell email-fact-first" width="33.33%" valign="top" style="width:33.33%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:4px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">账单编号</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px;">#{$invoice_id|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="33.33%" valign="top" style="width:33.33%; padding:15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:4px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">应付金额</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px;">${$amount|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="33.33%" valign="top" style="width:33.33%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:4px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">实例到期时间</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px;">{$due_at|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell email-fact-first" width="33.33%" valign="top" style="width:33.33%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:4px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Invoice</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px;">#{$invoice_id|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="33.33%" valign="top" style="width:33.33%; padding:15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:4px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Amount due</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px;">${$amount|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="33.33%" valign="top" style="width:33.33%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:4px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Instance expiry</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px;">{$due_at|escape:"html"}</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; box-shadow:0 8px 17px rgba(15,158,170,.16); mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$invoice_url|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">查看并支付账单</a></td></tr></table>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; box-shadow:0 8px 17px rgba(15,158,170,.16); mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$invoice_url|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">View and pay invoice</a></td></tr></table>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="email-panel" bgcolor="#fff1f3" style="padding:15px 16px; background-color:#fff1f3; border-radius:10px; color:#93404a; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#c43e4b;">重要提醒</strong>实例到期后将立即停用网络,续费成功后会自动恢复。到期满 3 天仍未支付,实例及其系统盘将被永久删除,数据无法恢复。</td></tr></table>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="email-panel" bgcolor="#fff1f3" style="padding:15px 16px; background-color:#fff1f3; border-radius:10px; color:#93404a; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#c43e4b;">Important</strong>Network access is suspended immediately when the instance expires and is restored automatically after renewal. If payment is still outstanding three days after expiry, the instance and its system disk will be permanently deleted and cannot be recovered.</td></tr></table>
|
||||
{/block}
|
||||
|
||||
@ -1,31 +1,31 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}实例开通成功 | {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}实例 {$instance_name|escape:"html"} 已创建完成,可以进入控制台管理。{/block}
|
||||
{block name='email_title'}Instance provisioned{/block}
|
||||
{block name='preheader'}Instance {$instance_name|escape:"html"} is ready to manage in the control panel.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 10px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.8px;">INSTANCE READY</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">实例已开通</h1>
|
||||
<p class="email-copy" style="margin:0 0 23px; color:#53647a; font-size:15px; line-height:25px;">您的云服务器 <strong style="color:#34445a;">{$instance_name|escape:"html"}</strong> 已创建完成,现在可以进入控制台查看状态并进行管理。</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">Your instance is ready</h1>
|
||||
<p class="email-copy" style="margin:0 0 23px; color:#53647a; font-size:15px; line-height:25px;">Your cloud server <strong style="color:#34445a;">{$instance_name|escape:"html"}</strong> has been created. You can now view its status and manage it in the control panel.</p>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-panel" bgcolor="#eaf8f2" style="padding:14px 16px; background-color:#eaf8f2; border-radius:10px; color:#208764; font-size:13px; line-height:20px; font-weight:800;">● 实例状态:开通成功</td></tr></table>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-panel" bgcolor="#eaf8f2" style="padding:14px 16px; background-color:#eaf8f2; border-radius:10px; color:#208764; font-size:13px; line-height:20px; font-weight:800;">● Instance status: Provisioned</td></tr></table>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="width:100%; margin:0 0 22px; background-color:#f2f6f9; border-radius:12px;">
|
||||
<tr>
|
||||
<td class="email-fact-cell email-fact-first" width="50%" valign="top" style="width:50%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">实例名称</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$instance_name|escape:"html"}</strong><small style="display:block; margin-top:3px; color:#91a0af; font-size:10px; line-height:16px;">实例 #{$instance_id|escape:"html"}</small></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">地区</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$region|default:'—'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell email-fact-first" width="50%" valign="top" style="width:50%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Instance name</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$instance_name|escape:"html"}</strong><small style="display:block; margin-top:3px; color:#91a0af; font-size:10px; line-height:16px;">Instance #{$instance_id|escape:"html"}</small></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Region</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$region|default:'—'|escape:"html"}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">公网 IP</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$public_ip|default:'—'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">操作系统</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$os_name|default:'—'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Public IP</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$public_ip|default:'—'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Operating system</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$os_name|default:'—'|escape:"html"}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">SSH 登录用户</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$login_name|default:'root'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">开通时间</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$created_at|default:'—'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 14px 15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">SSH login user</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$login_name|default:'root'|escape:"html"}</strong></td>
|
||||
<td class="email-fact-cell" width="50%" valign="top" style="width:50%; padding:15px 16px 15px 14px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Provisioned at</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$created_at|default:'—'|escape:"html"}</strong></td>
|
||||
</tr>
|
||||
<tr><td class="email-fact-cell" width="100%" colspan="2" valign="top" style="width:100%; padding:15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">服务到期时间</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$expires_at|default:'—'|escape:"html"}</strong></td></tr>
|
||||
<tr><td class="email-fact-cell" width="100%" colspan="2" valign="top" style="width:100%; padding:15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Service expiry</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$expires_at|default:'—'|escape:"html"}</strong></td></tr>
|
||||
</table>
|
||||
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 20px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; box-shadow:0 8px 17px rgba(15,158,170,.16); mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$instance_url|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">管理我的实例</a></td></tr></table>
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:21px;">出于安全考虑,本邮件不会展示账户密码、私钥或其他登录凭据。请前往实例详情页面查看面板保存的信息。</p>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 20px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; box-shadow:0 8px 17px rgba(15,158,170,.16); mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$instance_url|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">Manage instance</a></td></tr></table>
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:21px;">For security, this email does not include account passwords, private keys, or other login credentials. Visit the instance details page to view information stored by the control panel.</p>
|
||||
{/block}
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}数据库备份已完成 | {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}数据库备份已完成,备份文件随邮件发送。{/block}
|
||||
{block name='email_title'}Database backup completed{/block}
|
||||
{block name='preheader'}The database backup is complete and attached to this email.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 9px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.7px;">SYSTEM BACKUP</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">数据库备份已完成</h1>
|
||||
<p class="email-copy" style="margin:0 0 22px; color:#53647a; font-size:15px; line-height:25px;">系统已完成本次数据库备份,备份文件已作为附件随邮件发送。</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">Database backup completed</h1>
|
||||
<p class="email-copy" style="margin:0 0 22px; color:#53647a; font-size:15px; line-height:25px;">The database backup is complete. The backup file is attached to this email.</p>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 20px;">
|
||||
<tr><td class="email-panel" bgcolor="#f2f6f9" style="padding:17px 18px; background-color:#f2f6f9; border-radius:11px; color:#34485d; font-size:14px; line-height:23px;">{$text|default:'备份任务已成功完成。'|escape:"html"|nl2br}</td></tr>
|
||||
<tr><td class="email-panel" bgcolor="#f2f6f9" style="padding:17px 18px; background-color:#f2f6f9; border-radius:11px; color:#34485d; font-size:14px; line-height:23px;">{$text|default:'The backup task completed successfully.'|escape:"html"|nl2br}</td></tr>
|
||||
</table>
|
||||
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:20px;">请妥善保管备份附件及解密口令,不要将其转发给无关人员。</p>
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:20px;">Keep the backup attachment and decryption passphrase secure. Do not forward them to unauthorized people.</p>
|
||||
{/block}
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}新年专享优惠 | {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}新年专享套餐优惠,登录控制台即可参与。{/block}
|
||||
{block name='email_title'}New Year offer{/block}
|
||||
{block name='preheader'}A New Year plan offer is available in the control panel.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 9px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.7px;">NEW YEAR OFFER</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">新年专享优惠</h1>
|
||||
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">亲爱的用户,感谢您一直以来对 {$config["appName"]|escape:"html"} 的支持与信任。我们准备了新年专享套餐优惠,期待继续为您提供稳定的服务。</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">New Year offer</h1>
|
||||
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">Thank you for your continued support and trust in {$config["appName"]|escape:"html"}. We have prepared a New Year plan offer and look forward to continuing to provide reliable service.</p>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="width:100%; margin:0 0 20px; background-color:#f2f6f9; border-radius:12px;">
|
||||
<tr><td class="email-panel" style="padding:17px 18px 8px; color:#34485d; font-size:14px; line-height:23px;"><strong style="display:block; margin-bottom:7px; color:#15243a; font-size:15px;">套餐优惠</strong><ul style="margin:0; padding:0 0 0 19px;"><li style="margin:0 0 7px;"><strong>轻量套餐、标准季付:</strong>享受 9 折优惠。</li><li style="margin:0 0 7px;"><strong>标准年付套餐:</strong>享受 8 折优惠。</li></ul></td></tr>
|
||||
<tr><td class="email-panel" style="padding:8px 18px 17px; color:#34485d; font-size:14px; line-height:23px;"><strong style="display:block; margin-bottom:7px; color:#15243a; font-size:15px;">优惠码</strong><span style="display:block;">标准年付:<strong style="color:#0f8f9a;">20%myssr</strong></span><span style="display:block;">轻量套餐、标准季付:<strong style="color:#0f8f9a;">10%myssr</strong></span></td></tr>
|
||||
<tr><td class="email-panel" style="padding:17px 18px 8px; color:#34485d; font-size:14px; line-height:23px;"><strong style="display:block; margin-bottom:7px; color:#15243a; font-size:15px;">Plan discounts</strong><ul style="margin:0; padding:0 0 0 19px;"><li style="margin:0 0 7px;"><strong>Lightweight and standard quarterly plans:</strong> 10% off.</li><li style="margin:0 0 7px;"><strong>Standard annual plans:</strong> 20% off.</li></ul></td></tr>
|
||||
<tr><td class="email-panel" style="padding:8px 18px 17px; color:#34485d; font-size:14px; line-height:23px;"><strong style="display:block; margin-bottom:7px; color:#15243a; font-size:15px;">Promo codes</strong><span style="display:block;">Standard annual: <strong style="color:#0f8f9a;">20%myssr</strong></span><span style="display:block;">Lightweight and standard quarterly: <strong style="color:#0f8f9a;">10%myssr</strong></span></td></tr>
|
||||
</table>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 22px;"><tr><td class="email-panel" bgcolor="#fff7e8" style="padding:15px 16px; background-color:#fff7e8; border-radius:10px; color:#8d611f; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#a66a19;">温馨提示</strong>当前套餐如仍有剩余价值,购买新套餐时可按系统页面展示的规则抵扣,并可叠加适用的优惠码。</td></tr></table>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 22px;"><tr><td class="email-panel" bgcolor="#fff7e8" style="padding:15px 16px; background-color:#fff7e8; border-radius:10px; color:#8d611f; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#a66a19;">Please note</strong>If your current plan still has remaining value, the amount may be credited toward a new plan according to the rules shown in the control panel. Eligible promo codes can also be applied.</td></tr></table>
|
||||
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$config["baseUrl"]|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">登录查看优惠</a></td></tr></table>
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:20px;">感谢您的支持。<br><strong style="color:#607086;">{$config["appName"]|escape:"html"} 团队</strong></p>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$config["baseUrl"]|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">View offer</a></td></tr></table>
|
||||
<p style="margin:0; color:#8390a2; font-size:12px; line-height:20px;">Thank you for your support.<br><strong style="color:#607086;">The {$config["appName"]|escape:"html"} team</strong></p>
|
||||
{/block}
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}{if $language == 'true'}Reset your password{else}重置账户密码{/if} | {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}{if $language == 'true'}Use the secure link in this email to reset your password.{else}请使用邮件中的安全链接重置账户密码。{/if}{/block}
|
||||
{block name='email_title'}Reset your password{/block}
|
||||
{block name='preheader'}Use the secure link in this email to reset your password.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 10px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.8px; text-transform:uppercase;">ACCOUNT SECURITY</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">{if $language == 'true'}Reset your password{else}重置账户密码{/if}</h1>
|
||||
<p class="email-copy" style="margin:0 0 24px; color:#53647a; font-size:15px; line-height:25px;">{if $language == 'true'}We received a request to reset the password for your {$config["appName"]|escape:"html"} account. Use the button below to continue.{else}我们收到了您为 {$config["appName"]|escape:"html"} 账户重置密码的请求,请点击下方按钮继续。{/if}</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">Reset your password</h1>
|
||||
<p class="email-copy" style="margin:0 0 24px; color:#53647a; font-size:15px; line-height:25px;">We received a request to reset the password for your {$config["appName"]|escape:"html"} account. Use the button below to continue.</p>
|
||||
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; box-shadow:0 8px 17px rgba(15,158,170,.16); mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$resetUrl|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">{if $language == 'true'}Reset password{else}前往重置密码{/if}</a></td></tr></table>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 22px;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px; background-color:#0f9eaa; box-shadow:0 8px 17px rgba(15,158,170,.16); mso-padding-alt:13px 22px;"><a class="email-button-link" href="{$resetUrl|escape:"html"}" style="display:inline-block; padding:13px 22px; color:#ffffff; font-size:14px; line-height:20px; font-weight:800; text-decoration:none; border-radius:9px;">Reset password</a></td></tr></table>
|
||||
|
||||
{if !empty($expire)}
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 20px;"><tr><td class="email-panel" bgcolor="#f2f6f9" style="padding:14px 16px; background-color:#f2f6f9; border-radius:9px; color:#53647a; font-size:12px; line-height:20px;">{if $language == 'true'}This reset link is valid until <strong style="color:#34445a;">{$expire|escape:"html"}</strong>.{else}此重置链接将在 <strong style="color:#34445a;">{$expire|escape:"html"}</strong> 失效。{/if}</td></tr></table>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 20px;"><tr><td class="email-panel" bgcolor="#f2f6f9" style="padding:14px 16px; background-color:#f2f6f9; border-radius:9px; color:#53647a; font-size:12px; line-height:20px;">This reset link is valid until <strong style="color:#34445a;">{$expire|escape:"html"}</strong>.</td></tr></table>
|
||||
{/if}
|
||||
|
||||
<p style="margin:0 0 8px; color:#8390a2; font-size:12px; line-height:20px;">{if $language == 'true'}If the button does not work, copy and paste this address into your browser:{else}如果按钮无法打开,请复制以下地址并粘贴到浏览器:{/if}</p>
|
||||
<p style="margin:0 0 8px; color:#8390a2; font-size:12px; line-height:20px;">If the button does not work, copy and paste this address into your browser:</p>
|
||||
<p style="margin:0 0 22px; padding:12px 14px; background-color:#f2f6f9; border-radius:9px; color:#0f8f9a; font-family:'SFMono-Regular',Consolas,'Liberation Mono',monospace; font-size:11px; line-height:18px; word-break:break-all; overflow-wrap:anywhere;"><a href="{$resetUrl|escape:"html"}" style="color:#0f8f9a; text-decoration:none; word-break:break-all; overflow-wrap:anywhere;">{$resetUrl|escape:"html"}</a></p>
|
||||
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="email-panel" bgcolor="#fff7e8" style="padding:15px 16px; background-color:#fff7e8; border-radius:10px; color:#8d611f; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#a66a19;">{if $language == 'true'}Security notice{else}安全提示{/if}</strong>{if $language == 'true'}If you did not request a password reset, ignore this email. Do not forward this message or share the reset link with anyone.{else}如果并非您本人申请重置密码,请忽略此邮件。请勿转发本邮件或向任何人泄露重置链接。{/if}</td></tr></table>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="email-panel" bgcolor="#fff7e8" style="padding:15px 16px; background-color:#fff7e8; border-radius:10px; color:#8d611f; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#a66a19;">Security notice</strong>If you did not request a password reset, ignore this email. Do not forward this message or share the reset link with anyone.</td></tr></table>
|
||||
{/block}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
{extends file='layout.tpl'}
|
||||
|
||||
{block name='email_title'}邮件服务测试 | {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}这是一封邮件服务配置测试邮件。{/block}
|
||||
{block name='email_title'}Email delivery test{/block}
|
||||
{block name='preheader'}This is a test of the email delivery configuration.{/block}
|
||||
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 9px; color:#159da9; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.7px;">DELIVERY TEST</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">邮件服务连接正常</h1>
|
||||
<p class="email-copy" style="margin:0 0 22px; color:#53647a; font-size:15px; line-height:25px;">如果您收到这封邮件,说明 {$config["appName"]|escape:"html"} 的邮件发送配置工作正常。</p>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="email-panel" bgcolor="#eaf8f2" style="padding:16px 17px; background-color:#eaf8f2; border-radius:11px; color:#26765c; font-size:13px; line-height:21px;"><strong style="display:block; margin-bottom:3px; color:#208764;">测试发送时间</strong>{$time|default:'—'|escape:"html"}</td></tr></table>
|
||||
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">Email delivery is working</h1>
|
||||
<p class="email-copy" style="margin:0 0 22px; color:#53647a; font-size:15px; line-height:25px;">If you received this message, the email delivery configuration for {$config["appName"]|escape:"html"} is working correctly.</p>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="email-panel" bgcolor="#eaf8f2" style="padding:16px 17px; background-color:#eaf8f2; border-radius:11px; color:#26765c; font-size:13px; line-height:21px;"><strong style="display:block; margin-bottom:3px; color:#208764;">Test sent at</strong>{$time|default:'—'|escape:"html"}</td></tr></table>
|
||||
{/block}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{extends file='layout.tpl'}
|
||||
{block name='email_title'}工单已创建 · {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}你的工单已提交,管理员会尽快处理。{/block}
|
||||
{block name='email_title'}Ticket created{/block}
|
||||
{block name='preheader'}Your ticket has been submitted and will be reviewed as soon as possible.{/block}
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 8px;color:#8390a2;font-size:12px;letter-spacing:1.8px;font-weight:800;text-transform:uppercase;">TICKET CREATED</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px;color:#15243a;font-size:28px;line-height:36px;font-weight:800;letter-spacing:-.5px;">工单已提交</h1>
|
||||
<p class="email-copy" style="margin:0 0 20px;color:#52647b;font-size:15px;line-height:25px;">您好,{$user->user_name|default:'用户'|escape:"html"},你的工单已经创建成功。管理员回复后,我们会再次通过邮件提醒你。</p>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="margin:0 0 24px;background-color:#f2f6f9;border-radius:12px;"><tr><td class="email-panel" style="padding:17px 18px;"><p style="margin:0 0 5px;color:#8a98aa;font-size:12px;">工单 #{$ticket->id|escape:"html"}</p><p style="margin:0;color:#15243a;font-size:17px;line-height:24px;font-weight:800;word-break:break-word;">{$ticket->title|escape:"html"}</p></td></tr></table>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px;background-color:#0f9eaa;mso-padding-alt:13px 22px;"><a href="{$ticket_url|escape:'html'}" class="email-button-link" style="display:inline-block;padding:13px 22px;border-radius:9px;color:#ffffff;font-size:14px;line-height:20px;font-weight:800;text-decoration:none;">查看工单</a></td></tr></table>
|
||||
<h1 class="email-title" style="margin:0 0 14px;color:#15243a;font-size:28px;line-height:36px;font-weight:800;letter-spacing:-.5px;">Ticket submitted</h1>
|
||||
<p class="email-copy" style="margin:0 0 20px;color:#52647b;font-size:15px;line-height:25px;">Hello {$user->user_name|default:'User'|escape:"html"}, your ticket has been created successfully. We will notify you by email when an administrator replies.</p>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="margin:0 0 24px;background-color:#f2f6f9;border-radius:12px;"><tr><td class="email-panel" style="padding:17px 18px;"><p style="margin:0 0 5px;color:#8a98aa;font-size:12px;">Ticket #{$ticket->id|escape:"html"}</p><p style="margin:0;color:#15243a;font-size:17px;line-height:24px;font-weight:800;word-break:break-word;">{$ticket->title|escape:"html"}</p></td></tr></table>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px;background-color:#0f9eaa;mso-padding-alt:13px 22px;"><a href="{$ticket_url|escape:'html'}" class="email-button-link" style="display:inline-block;padding:13px 22px;border-radius:9px;color:#ffffff;font-size:14px;line-height:20px;font-weight:800;text-decoration:none;">View ticket</a></td></tr></table>
|
||||
{/block}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{extends file='layout.tpl'}
|
||||
{block name='email_title'}工单收到回复 · {$config["appName"]|escape:"html"}{/block}
|
||||
{block name='preheader'}管理员已回复你的工单。{/block}
|
||||
{block name='email_title'}Ticket reply received{/block}
|
||||
{block name='preheader'}An administrator has replied to your ticket.{/block}
|
||||
{block name='content'}
|
||||
<p style="margin:0 0 8px;color:#8390a2;font-size:12px;letter-spacing:1.8px;font-weight:800;text-transform:uppercase;">TICKET REPLY</p>
|
||||
<h1 class="email-title" style="margin:0 0 14px;color:#15243a;font-size:28px;line-height:36px;font-weight:800;letter-spacing:-.5px;">工单收到回复</h1>
|
||||
<p class="email-copy" style="margin:0 0 20px;color:#52647b;font-size:15px;line-height:25px;">您好,{$user->user_name|default:'用户'|escape:"html"},管理员已经回复你的工单,请登录控制台查看完整内容。</p>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="margin:0 0 24px;background-color:#f2f6f9;border-radius:12px;"><tr><td class="email-panel" style="padding:17px 18px;"><p style="margin:0 0 5px;color:#8a98aa;font-size:12px;">工单 #{$ticket->id|escape:"html"}</p><p style="margin:0;color:#15243a;font-size:17px;line-height:24px;font-weight:800;word-break:break-word;">{$ticket->title|escape:"html"}</p></td></tr></table>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px;background-color:#0f9eaa;mso-padding-alt:13px 22px;"><a href="{$ticket_url|escape:'html'}" class="email-button-link" style="display:inline-block;padding:13px 22px;border-radius:9px;color:#ffffff;font-size:14px;line-height:20px;font-weight:800;text-decoration:none;">查看回复</a></td></tr></table>
|
||||
<h1 class="email-title" style="margin:0 0 14px;color:#15243a;font-size:28px;line-height:36px;font-weight:800;letter-spacing:-.5px;">Ticket reply received</h1>
|
||||
<p class="email-copy" style="margin:0 0 20px;color:#52647b;font-size:15px;line-height:25px;">Hello {$user->user_name|default:'User'|escape:"html"}, an administrator has replied to your ticket. Sign in to the control panel to view the full response.</p>
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f2f6f9" style="margin:0 0 24px;background-color:#f2f6f9;border-radius:12px;"><tr><td class="email-panel" style="padding:17px 18px;"><p style="margin:0 0 5px;color:#8a98aa;font-size:12px;">Ticket #{$ticket->id|escape:"html"}</p><p style="margin:0;color:#15243a;font-size:17px;line-height:24px;font-weight:800;word-break:break-word;">{$ticket->title|escape:"html"}</p></td></tr></table>
|
||||
<table class="email-button-table" role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0;"><tr><td class="email-button-cell" align="center" bgcolor="#0f9eaa" style="border-radius:9px;background-color:#0f9eaa;mso-padding-alt:13px 22px;"><a href="{$ticket_url|escape:'html'}" class="email-button-link" style="display:inline-block;padding:13px 22px;border-radius:9px;color:#ffffff;font-size:14px;line-height:20px;font-weight:800;text-decoration:none;">View reply</a></td></tr></table>
|
||||
{/block}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services {
|
||||
class SiteName
|
||||
{
|
||||
public static string $name = 'Default Site';
|
||||
|
||||
public static function defaultName(): string
|
||||
{
|
||||
return self::$name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
use App\Services\MailSenderIdentity;
|
||||
use App\Services\SiteName;
|
||||
|
||||
require dirname(__DIR__) . '/app/Services/MailSenderIdentity.php';
|
||||
|
||||
function expectMailSenderIdentity($condition, string $message): void
|
||||
{
|
||||
if (!$condition) {
|
||||
fwrite(STDERR, $message . PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
expectMailSenderIdentity(
|
||||
MailSenderIdentity::displayName() === 'Default Site',
|
||||
'The sender display name must use the site default title.'
|
||||
);
|
||||
|
||||
SiteName::$name = " Default\r\nSite\tTitle ";
|
||||
expectMailSenderIdentity(
|
||||
MailSenderIdentity::displayName() === 'Default Site Title',
|
||||
'Control characters were not removed from the sender display name.'
|
||||
);
|
||||
|
||||
SiteName::$name = 'Default "Cloud"';
|
||||
expectMailSenderIdentity(
|
||||
MailSenderIdentity::header('Legacy Name <sender@example.com>') === '"Default \\"Cloud\\"" <sender@example.com>',
|
||||
'The Mailgun sender header was not rebuilt from the default title and configured mailbox.'
|
||||
);
|
||||
|
||||
$invalidWasRejected = false;
|
||||
try {
|
||||
MailSenderIdentity::mailbox("sender@example.com\r\nBcc: victim@example.com");
|
||||
} catch (\InvalidArgumentException $exception) {
|
||||
$invalidWasRejected = true;
|
||||
}
|
||||
expectMailSenderIdentity($invalidWasRejected, 'A header-injection sender value was not rejected.');
|
||||
|
||||
$mailgunSource = file_get_contents(dirname(__DIR__) . '/app/Services/Mail/Mailgun.php');
|
||||
expectMailSenderIdentity(
|
||||
is_string($mailgunSource) && str_contains($mailgunSource, 'MailSenderIdentity::header'),
|
||||
'Mailgun does not use the shared sender identity.'
|
||||
);
|
||||
|
||||
echo 'Mail sender identity checks passed.' . PHP_EOL;
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
$root = dirname(__DIR__);
|
||||
$assert = static function ($condition, string $message): void {
|
||||
if (!$condition) {
|
||||
throw new RuntimeException($message);
|
||||
}
|
||||
};
|
||||
|
||||
$contracts = [
|
||||
'app/Controllers/AuthController.php' => [
|
||||
"'Login Verification'",
|
||||
"\$subject = 'Email Verification';",
|
||||
],
|
||||
'app/Services/AccountSecurityService.php' => [
|
||||
"'Password Change Verification'",
|
||||
],
|
||||
'app/Services/AccountEmailChangeService.php' => [
|
||||
"'Email Change Verification'",
|
||||
],
|
||||
'app/Services/Password.php' => [
|
||||
"\$subject = 'Password Reset';",
|
||||
],
|
||||
'app/Services/Cloud/CloudInvoiceService.php' => [
|
||||
"'Renewal Invoice Created'",
|
||||
"'Instance Provisioned'",
|
||||
],
|
||||
'app/Services/Cloud/CloudServiceCompensationNotificationService.php' => [
|
||||
"'subject' => 'Service Time Compensation Applied'",
|
||||
],
|
||||
'app/Services/Ticket/TicketNotificationDispatcher.php' => [
|
||||
"'Ticket Created'",
|
||||
"'New Ticket: ' . (string) \$root->title",
|
||||
"'Ticket Reply Received'",
|
||||
],
|
||||
'app/Controllers/Admin/UserController.php' => [
|
||||
"'Account Created'",
|
||||
"\$subject = trim((string) \$subjectFromFrontEnd);",
|
||||
],
|
||||
'app/Command/Job.php' => [
|
||||
"'Database Backup'",
|
||||
],
|
||||
];
|
||||
|
||||
$sources = [];
|
||||
foreach ($contracts as $relative => $needles) {
|
||||
$source = file_get_contents($root . '/' . $relative);
|
||||
$assert(is_string($source), 'Unable to read mail subject source: ' . $relative);
|
||||
foreach ($needles as $needle) {
|
||||
$assert(
|
||||
str_contains($source, $needle),
|
||||
'A required event-only English subject contract is missing in '
|
||||
. $relative . ': ' . $needle
|
||||
);
|
||||
}
|
||||
$sources[] = $source;
|
||||
}
|
||||
|
||||
$combined = implode("\n", $sources);
|
||||
$assert(
|
||||
preg_match(
|
||||
'/(?:Config::get\([\'\"]appName[\'\"]\)|\$appName)\s*\.\s*[\'\"][^\'\"]*[-–—]/',
|
||||
$combined
|
||||
) !== 1,
|
||||
'A system email subject still prepends the site title.'
|
||||
);
|
||||
|
||||
$authEntries = file_get_contents(
|
||||
$root . '/resources/user-copy/entries/auth.entries.php'
|
||||
);
|
||||
$assert(is_string($authEntries)
|
||||
&& !str_contains($authEntries, 'auth.login.verify.subject')
|
||||
&& !str_contains($authEntries, 'auth.register.verify.subject'),
|
||||
'Retired localized email-subject keys are still present in user copy.');
|
||||
|
||||
echo 'Event-only English mail subject contracts passed.' . PHP_EOL;
|
||||
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services {
|
||||
final class Config
|
||||
{
|
||||
public static function get($key, $default = null)
|
||||
{
|
||||
return [
|
||||
'mailgun_key' => 'test-key',
|
||||
'mailgun_domain' => 'mg.example.test',
|
||||
'mailgun_sender' => 'Legacy Name <sender@example.test>',
|
||||
'mailgun_endpoint' => 'https://api.mailgun.net',
|
||||
][$key] ?? $default;
|
||||
}
|
||||
}
|
||||
|
||||
final class SiteName
|
||||
{
|
||||
public static function defaultName(): string
|
||||
{
|
||||
return 'Default Site';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
use App\Services\Mail\Mailgun;
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
require dirname(__DIR__) . '/app/Services/MailSenderIdentity.php';
|
||||
require dirname(__DIR__) . '/app/Services/Mail/Base.php';
|
||||
require dirname(__DIR__) . '/app/Services/Mail/Mailgun.php';
|
||||
|
||||
final class MailgunMessagesProbe
|
||||
{
|
||||
public array $calls = [];
|
||||
|
||||
public function send($domain, array $message)
|
||||
{
|
||||
$this->calls[] = compact('domain', 'message');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
final class MailgunClientProbe
|
||||
{
|
||||
public function __construct(private MailgunMessagesProbe $messages)
|
||||
{
|
||||
}
|
||||
|
||||
public function messages(): MailgunMessagesProbe
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
}
|
||||
|
||||
$transport = new Mailgun();
|
||||
$messages = new MailgunMessagesProbe();
|
||||
$client = new MailgunClientProbe($messages);
|
||||
$property = (new ReflectionClass($transport))->getProperty('mg');
|
||||
$property->setValue($transport, $client);
|
||||
|
||||
if (!$transport->send(
|
||||
'recipient@example.test',
|
||||
'Instance Provisioned',
|
||||
'<p>Ready</p>',
|
||||
[]
|
||||
)) {
|
||||
throw new RuntimeException('The Mailgun transport rejected the probe.');
|
||||
}
|
||||
|
||||
$call = $messages->calls[0] ?? null;
|
||||
if (!is_array($call)
|
||||
|| ($call['domain'] ?? null) !== 'mg.example.test'
|
||||
|| ($call['message']['from'] ?? null)
|
||||
!== '"Default Site" <sender@example.test>'
|
||||
|| ($call['message']['subject'] ?? null) !== 'Instance Provisioned') {
|
||||
throw new RuntimeException(
|
||||
'Mailgun did not build the final payload from the default site title.'
|
||||
);
|
||||
}
|
||||
|
||||
echo 'Mailgun sender identity checks passed.' . PHP_EOL;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models {
|
||||
final class Configurations
|
||||
{
|
||||
public static string $value = '';
|
||||
public static bool $throw = false;
|
||||
|
||||
public static function where($column, $value): object
|
||||
{
|
||||
if (self::$throw) {
|
||||
throw new \RuntimeException('Configuration storage unavailable.');
|
||||
}
|
||||
|
||||
return new class {
|
||||
public function value($column): string
|
||||
{
|
||||
return Configurations::$value;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace App\Services {
|
||||
final class RedisClient
|
||||
{
|
||||
public function get($key, $minutes = null, $callback = null)
|
||||
{
|
||||
return $callback === null ? null : $callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
use App\Models\Configurations;
|
||||
use App\Services\SiteName;
|
||||
|
||||
require dirname(__DIR__) . '/app/Services/SiteName.php';
|
||||
|
||||
$assert = static function ($condition, string $message): void {
|
||||
if (!$condition) {
|
||||
throw new \RuntimeException($message);
|
||||
}
|
||||
};
|
||||
|
||||
$_SERVER['HTTP_HOST'] = 'mapped.example.test';
|
||||
Configurations::$value = 'Default Site Title';
|
||||
$assert(
|
||||
SiteName::defaultName() === 'Default Site Title',
|
||||
'The mail identity did not read the administrator default title.'
|
||||
);
|
||||
|
||||
Configurations::$value = " \t ";
|
||||
$assert(
|
||||
SiteName::defaultName() === 'Site',
|
||||
'An empty default title did not use the English mail fallback.'
|
||||
);
|
||||
|
||||
Configurations::$throw = true;
|
||||
$assert(
|
||||
SiteName::defaultName() === 'Site',
|
||||
'A configuration read failure did not use the English mail fallback.'
|
||||
);
|
||||
|
||||
echo 'Site default-title checks passed.' . PHP_EOL;
|
||||
}
|
||||
Loading…
Reference in New Issue