Standardize English email branding

go
codex 1 week ago
parent 3286342f52
commit f74037220a

@ -129,9 +129,10 @@ class Job
}
if (!Mail::send(
$recipient,
Config::get('appName') . '-数据库备份',
'Database Backup',
'news/backup.tpl',
['text' => '数据库 SQL 备份已使用 AES-256 加密,请使用您配置的备份口令解压。'],
['text' => 'The SQL database backup is encrypted with AES-256. '
. 'Use the configured backup passphrase to extract it.'],
[$archive]
)) {
throw new \RuntimeException('备份已保存,但邮件服务未接受备份邮件。');

@ -5,7 +5,6 @@ namespace App\Controllers\Admin;
use App\Services\Auth;
use App\Services\AdminDataMasker;
use App\Services\AdminPermission;
use App\Services\Config;
use App\Services\Mail;
use App\Services\LoginSessionRevocationService;
use App\Services\RedisClient;
@ -66,8 +65,10 @@ class UserController extends AdminController
if (!$user->save()) {
return $this->echoJson($response, ['ret' => 0, 'msg' => '创建失败']);
}
$sent = Mail::send($email, Config::get('appName') . ' - 新用户注册通知', 'news/monitor.tpl', [
'user' => $user, 'text' => '管理员为您创建了账户,邮箱:' . $email . ',初始密码:' . $password,
$sent = Mail::send($email, 'Account Created', 'news/monitor.tpl', [
'user' => $user,
'text' => 'An administrator created your account. Email: ' . $email
. '. Initial password: ' . $password,
]);
return $this->echoJson($response, [
@ -198,7 +199,7 @@ class UserController extends AdminController
if (AdminPermission::isSuperAdmin() && $user) {
$to = $user->email;
$subject = Config::get('appName') . ' - ' . $subjectFromFrontEnd;
$subject = trim((string) $subjectFromFrontEnd);
$text = $contentFromFrontEnd;
try {
$sent = Mail::send($to, $subject, 'news/monitor.tpl', [

@ -644,9 +644,7 @@ class AuthController extends BaseController
}
try {
$sent = Mail::send($email, $this->publicCopy('auth.login', 'auth.login.verify.subject', [
'site' => (string) Config::get('appName'),
]), 'auth/verify.tpl', [
$sent = Mail::send($email, 'Login Verification', 'auth/verify.tpl', [
"code" => $code,
"expire" => date("Y-m-d H:i:s", time() + (int) CaptchaConfig::get('email_verify_ttl')),
"language" => $this->language,
@ -769,9 +767,7 @@ class AuthController extends BaseController
return $response->getBody()->write(json_encode($res));
}
$subject = $this->publicCopy('auth.register', 'auth.register.verify.subject', [
'site' => (string) Config::get('appName'),
]);
$subject = 'Email Verification';
try {
$sent = Mail::send($email, $subject, 'auth/verify.tpl', [

@ -77,7 +77,7 @@ final class AccountEmailChangeService
try {
$sent = Mail::send(
$newEmail,
Config::get('appName') . ' - 修改邮箱验证',
'Email Change Verification',
'auth/verify.tpl',
[
'code' => $plainCode,

@ -64,7 +64,7 @@ class AccountSecurityService
try {
$sent = Mail::send(
$email,
Config::get('appName') . ' - 修改密码验证',
'Password Change Verification',
'auth/verify.tpl',
[
'code' => $plainCode,

@ -807,10 +807,9 @@ final class CloudInvoiceService
$error = '用户邮箱无效';
} else {
$base = rtrim((string) Config::get('baseUrl', ''), '/');
$appName = trim((string) Config::get('appName', ''));
if ($kind === 'renewal_due') {
$ok = Mail::send((string) $user->email,
($appName !== '' ? $appName . ' - ' : '') . '实例续费账单已生成',
'Renewal Invoice Created',
'cloud/invoice.tpl', [
'invoice_id' => (string) $invoice->id,
'instance_name' => (string) $instance->name,
@ -845,20 +844,20 @@ final class CloudInvoiceService
?? $spec['template_id'] ?? ''));
$loginName = trim((string) ($spec['login_name'] ?? ''));
$ok = Mail::send((string) $user->email,
($appName !== '' ? $appName . ' - ' : '') . '实例开通成功',
'Instance Provisioned',
'cloud/provision-success.tpl', [
'instance_name' => (string) $instance->name,
'instance_id' => (string) $instance->id,
'region' => $region !== '' ? $region : '—',
'public_ip' => $ip,
'os_name' => $osName !== '' ? $osName : '云镜像系统',
'os_name' => $osName !== '' ? $osName : 'Cloud image',
'login_name' => preg_match(
'/^[A-Za-z_][A-Za-z0-9_.-]{0,31}$/D', $loginName
) === 1 ? $loginName : 'root',
'created_at' => date('Y-m-d H:i:s',
(int) $instance->created_at),
'expires_at' => $instance->expires_at === null
? '未设置' : date('Y-m-d H:i:s',
? 'Not set' : date('Y-m-d H:i:s',
(int) $instance->expires_at),
'instance_url' => $base . '/user/cloud/instances/'
. (int) $instance->id,

@ -207,10 +207,10 @@ final class CloudMaintenanceNoticeDeliveryService
throw new \RuntimeException('Maintenance instance list is empty.');
}
$impacts = [
'network_interruption' => '网络可能短时中断',
'instance_restart' => '实例将重新启动',
'service_interruption' => '服务可能短时中断',
'no_interruption' => '预计不会中断服务',
'network_interruption' => 'Network connectivity may be briefly interrupted',
'instance_restart' => 'Instances will be restarted',
'service_interruption' => 'Service may be briefly interrupted',
'no_interruption' => 'No service interruption is expected',
];
$impact = $impacts[(string) $notice->impact] ?? null;
if ($impact === null) {

@ -330,10 +330,12 @@ final class CloudServiceCompensationNotificationService
throw new \RuntimeException('Compensation payload is invalid.');
}
return [
'subject' => '实例可用时间补偿已到账',
'subject' => 'Service Time Compensation Applied',
'variables' => [
'reason_text' => $payload['reason_text'],
'scope_label' => (string) ($payload['scope_label'] ?? ''),
'scope_label' => self::scopeLabel(
(string) ($payload['scope_label'] ?? '')
),
'compensation_duration' => self::duration(
$payload['compensation_seconds']
),
@ -416,15 +418,26 @@ final class CloudServiceCompensationNotificationService
private static function duration(int $seconds): string
{
if ($seconds % 86400 === 0) {
return (int) ($seconds / 86400) . ' 天';
$value = (int) ($seconds / 86400);
return $value . ($value === 1 ? ' day' : ' days');
}
if ($seconds % 3600 === 0) {
return (int) ($seconds / 3600) . ' 小时';
$value = (int) ($seconds / 3600);
return $value . ($value === 1 ? ' hour' : ' hours');
}
if ($seconds % 60 === 0) {
return (int) ($seconds / 60) . ' 分钟';
$value = (int) ($seconds / 60);
return $value . ($value === 1 ? ' minute' : ' minutes');
}
return $seconds . ($seconds === 1 ? ' second' : ' seconds');
}
private static function scopeLabel(string $label): string
{
if (preg_match('/^单实例\s*#(\d+)$/u', $label, $matches) === 1) {
return 'Instance #' . $matches[1];
}
return $seconds . ' 秒';
return $label;
}
private static function incidentWindow(array $payload): string
@ -432,7 +445,7 @@ final class CloudServiceCompensationNotificationService
$start = $payload['incident_starts_at'] ?? null;
$end = $payload['incident_ends_at'] ?? null;
if (!is_int($start) || !is_int($end)) {
return '未单独记录';
return 'Not recorded separately';
}
return gmdate('Y-m-d H:i:s \U\T\C', $start)
. ' — ' . gmdate('Y-m-d H:i:s \U\T\C', $end);

@ -45,8 +45,11 @@ class Mail
$smarty->settemplatedir(BASE_PATH . '/resources/email/');
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
// add config
$smarty->assign('config', Config::getPublicConfig());
// Mail branding is global. It must use the administrator-managed
// default title instead of a request-domain-specific site mapping.
$publicConfig = Config::getPublicConfig();
$publicConfig['appName'] = MailSenderIdentity::displayName();
$smarty->assign('config', $publicConfig);
foreach ($ary as $key => $value) {
$smarty->assign($key, $value);
}

@ -3,6 +3,7 @@
namespace App\Services\Mail;
use App\Services\Config;
use App\Services\MailSenderIdentity;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\HttpFactory;
use Mailgun\HttpClient\HttpClientConfigurator;
@ -24,7 +25,11 @@ class Mailgun extends Base
$this->validateConfig();
$this->mg = $this->createClient();
$this->domain = $this->config["domain"];
$this->sender = $this->config["sender"];
try {
$this->sender = MailSenderIdentity::header($this->config["sender"]);
} catch (\InvalidArgumentException $exception) {
throw new RuntimeException('Mailgun configuration mailgun_sender must contain a valid email address.', 0, $exception);
}
}
public function getConfig()

@ -4,6 +4,7 @@
namespace App\Services\Mail;
use App\Services\Config;
use App\Services\MailSenderIdentity;
use PHPMailer\PHPMailer\PHPMailer;
class Smtp extends Base
@ -15,7 +16,7 @@ class Smtp extends Base
"username" => Config::get('smtp_username'),
"port" => Config::get('smtp_port'),
"sender" => Config::get('smtp_sender'),
"name" => Config::get('smtp_name'),
"name" => MailSenderIdentity::displayName(),
"passsword" => Config::get('smtp_passsword')
];
}

@ -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);
}
}

@ -28,8 +28,7 @@ class Password
return false;
}
$subject = Config::get('appName') . ($english
? ' - Password reset' : ' - 重置密码');
$subject = 'Password Reset';
$resetUrl = Config::get('baseUrl') . "/password/token/" . $pwdRst->token;
try {
$sent = Mail::send($email, $subject, 'password/reset.tpl', [

@ -24,6 +24,18 @@ class SiteName
return self::resolveFromConfig($host, $defaultName, $mappings ?? []);
}
/**
* Return the administrator-managed default site title without applying a
* request-host mapping. Mail and other global identities must not vary by
* the domain that happened to trigger a background operation.
*/
public static function defaultName(): string
{
$name = trim(self::defaultAppName());
return $name !== '' ? $name : 'Site';
}
public static function resolveFromConfig($host, $defaultName, array $mappings): string
{
$requestHost = self::normalizeHost($host);

@ -25,15 +25,14 @@ final class TicketNotificationDispatcher
$root = $event->result->root;
$owner = User::where('id', (int) $root->userid)->first();
$jobs = [];
$appName = (string) Config::get('appName');
$ticketUrl = rtrim((string) Config::get('baseUrl'), '/')
. '/user/ticket/' . (int) $root->id . '/view';
if ($event->kind === 'created' && $owner !== null && trim((string) $owner->email) !== '') {
$jobs[] = ['mail:owner', function () use ($owner, $root, $ticketUrl, $appName): void {
$jobs[] = ['mail:owner', function () use ($owner, $root, $ticketUrl): void {
$this->transport->sendMail(
(string) $owner->email,
$appName . ' - 工单已创建',
'Ticket Created',
'ticket/created.tpl',
['user' => $owner, 'ticket' => $root, 'ticket_url' => $ticketUrl],
'ticket_created'
@ -46,14 +45,15 @@ final class TicketNotificationDispatcher
if (trim((string) $admin->email) === '') {
continue;
}
$jobs[] = ['mail:admin:' . (int) $admin->id, function () use ($admin, $root, $appName): void {
$jobs[] = ['mail:admin:' . (int) $admin->id, function () use ($admin, $root): void {
$this->transport->sendMail(
(string) $admin->email,
$appName . ' - ' . (string) $root->title,
'New Ticket: ' . (string) $root->title,
'news/warn.tpl',
[
'user' => $admin,
'text' => '工单 #' . (int) $root->id . ' 有新的消息,请在网站管理页面查看。',
'text' => 'Ticket #' . (int) $root->id
. ' has a new message. Open the admin panel to review it.',
]
);
}];
@ -64,10 +64,10 @@ final class TicketNotificationDispatcher
}
if ($event->kind === 'admin_reply' && $owner !== null && trim((string) $owner->email) !== '') {
$jobs[] = ['mail:owner', function () use ($owner, $root, $ticketUrl, $appName): void {
$jobs[] = ['mail:owner', function () use ($owner, $root, $ticketUrl): void {
$this->transport->sendMail(
(string) $owner->email,
$appName . ' - 工单收到回复',
'Ticket Reply Received',
'ticket/replied.tpl',
['user' => $owner, 'ticket' => $root, 'ticket_url' => $ticketUrl],
'ticket_replied'

@ -9,7 +9,7 @@ $System_Config['mailgun_sender'] = '';
$System_Config['smtp_host'] = '';
$System_Config['smtp_username'] = '';
$System_Config['smtp_port'] = '';
$System_Config['smtp_name'] = '';
# The sender display name comes from Site Settings -> Default title.
$System_Config['smtp_sender'] = '';
$System_Config['smtp_passsword'] = '';
$System_Config['smtp_ssl'] = 'true';

@ -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;">&#36;{$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;">&#36;{$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,7 +1,7 @@
{extends file='layout.tpl'}
{block name='email_title'}{$notice_subject|escape:"html"} | {$config["appName"]|escape:"html"}{/block}
{block name='preheader'}{$scope_label|escape:"html"} 将进行维护,请查看受影响实例和 UTC 时间窗口。{/block}
{block name='email_title'}{$notice_subject|escape:"html"}{/block}
{block name='preheader'}Maintenance is scheduled for {$scope_label|escape:"html"}. Review the affected instances and UTC maintenance window.{/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;">MAINTENANCE NOTICE</p>
@ -10,21 +10,21 @@
<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;">{$scope_label|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;">{$impact_label|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;">Maintenance scope</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$scope_label|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;">Expected impact</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$impact_label|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;">开始时间(UTC)</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$maintenance_starts_utc|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;">结束时间(UTC)</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$maintenance_ends_utc|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;">Start time (UTC)</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$maintenance_starts_utc|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;">End time (UTC)</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$maintenance_ends_utc|escape:"html"}</strong></td>
</tr>
</table>
<p style="margin:0 0 10px; color:#34445a; font-size:13px; line-height:20px; font-weight:800;">受影响的实例</p>
<p style="margin:0 0 10px; color:#34445a; font-size:13px; line-height:20px; font-weight:800;">Affected instances</p>
{foreach $instances as $instance}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f8fb" style="width:100%; margin:0 0 10px; background-color:#f5f8fb; border-radius:10px;">
<tr><td class="email-panel" style="padding:14px 16px; color:#53647a; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#263d53; font-size:14px; line-height:20px; word-break:break-word;">{$instance.name|escape:"html"}</strong><span style="display:block; word-break:break-all;">IPv4:{$instance.ipv4|default:'—'|escape:"html"}</span><span style="display:block; word-break:break-all;">IPv6:{$instance.ipv6|default:'—'|escape:"html"}</span></td></tr>
<tr><td class="email-panel" style="padding:14px 16px; color:#53647a; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#263d53; font-size:14px; line-height:20px; word-break:break-word;">{$instance.name|escape:"html"}</strong><span style="display:block; word-break:break-all;">IPv4: {$instance.ipv4|default:'—'|escape:"html"}</span><span style="display:block; word-break:break-all;">IPv6: {$instance.ipv6|default:'—'|escape:"html"}</span></td></tr>
</table>
{/foreach}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:12px 0 0;"><tr><td class="email-panel" bgcolor="#fff4e7" style="padding:15px 16px; background-color:#fff4e7; border-radius:10px; color:#8d622d; font-size:12px; line-height:20px;">维护时间统一使用 UTC。实际开始和结束时间可能因现场进度略有变化,请提前保存未完成的工作。</td></tr></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:12px 0 0;"><tr><td class="email-panel" bgcolor="#fff4e7" style="padding:15px 16px; background-color:#fff4e7; border-radius:10px; color:#8d622d; font-size:12px; line-height:20px;">All maintenance times are shown in UTC. Actual start and end times may vary slightly as work progresses. Please save any unfinished work in advance.</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;">●&nbsp;&nbsp;实例状态:开通成功</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;">●&nbsp;&nbsp;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,32 +1,32 @@
{extends file='layout.tpl'}
{block name='email_title'}实例可用时间补偿已到账 | {$config["appName"]|escape:"html"}{/block}
{block name='preheader'}受影响实例的服务到期时间已经延长,请查看补偿结果。{/block}
{block name='email_title'}Service time compensation applied{/block}
{block name='preheader'}The service expiry time of the affected instances has been extended. Review the compensation details.{/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 CREDIT</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;">因以下事件受到影响的实例已完成服务时间补偿。本次操作不会产生账单,也不会改变账户余额或流量额度。</p>
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">Service time compensation applied</h1>
<p class="email-copy" style="margin:0 0 23px; color:#53647a; font-size:15px; line-height:25px;">Service time compensation has been applied to the instances affected by the event below. This action does not create an invoice or change your account balance or traffic allowance.</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="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;">{$scope_label|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;">{$compensation_duration|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;">Compensation scope</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$scope_label|default:'Instance service'|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;">Compensation duration</span><strong style="display:block; color:#2b4055; font-size:14px; line-height:20px; word-break:break-word;">{$compensation_duration|escape:"html"}</strong></td>
</tr>
<tr>
<td colspan="2" valign="top" style="padding:15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">事件时间(UTC)</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$incident_window_utc|escape:"html"}</strong></td>
<td colspan="2" valign="top" style="padding:15px 16px; vertical-align:top;"><span style="display:block; margin-bottom:5px; color:#8494a6; font-size:10px; line-height:15px; font-weight:700;">Incident window (UTC)</span><strong style="display:block; color:#2b4055; font-size:13px; line-height:20px; word-break:break-word;">{$incident_window_utc|escape:"html"}</strong></td>
</tr>
</table>
<p style="margin:0 0 10px; color:#34445a; font-size:13px; line-height:20px; font-weight:800;">补偿原因</p>
<p style="margin:0 0 10px; color:#34445a; font-size:13px; line-height:20px; font-weight:800;">Compensation reason</p>
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:14px; line-height:23px;">{$reason_text|escape:"html"|nl2br}</p>
<p style="margin:0 0 10px; color:#34445a; font-size:13px; line-height:20px; font-weight:800;">已补偿的实例</p>
<p style="margin:0 0 10px; color:#34445a; font-size:13px; line-height:20px; font-weight:800;">Compensated instances</p>
{foreach $instances as $instance}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f8fb" style="width:100%; margin:0 0 10px; background-color:#f5f8fb; border-radius:10px;">
<tr><td class="email-panel" style="padding:14px 16px; color:#53647a; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#263d53; font-size:14px; line-height:20px; word-break:break-word;">{$instance.instance_name|escape:"html"}</strong><span style="display:block;">原到期时间:{$instance.previous_expires_utc|escape:"html"}</span><span style="display:block;">新到期时间:{$instance.new_expires_utc|escape:"html"}</span></td></tr>
<tr><td class="email-panel" style="padding:14px 16px; color:#53647a; font-size:12px; line-height:20px;"><strong style="display:block; margin-bottom:3px; color:#263d53; font-size:14px; line-height:20px; word-break:break-word;">{$instance.instance_name|escape:"html"}</strong><span style="display:block;">Previous expiry: {$instance.previous_expires_utc|escape:"html"}</span><span style="display:block;">New expiry: {$instance.new_expires_utc|escape:"html"}</span></td></tr>
</table>
{/foreach}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:12px 0 0;"><tr><td class="email-panel" bgcolor="#edf8f6" style="padding:15px 16px; background-color:#edf8f6; border-radius:10px; color:#31756d; font-size:12px; line-height:20px;">补偿已经直接计入实例当前服务周期,无需进行支付或其他操作。时间统一使用 UTC。</td></tr></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:12px 0 0;"><tr><td class="email-panel" bgcolor="#edf8f6" style="padding:15px 16px; background-color:#edf8f6; border-radius:10px; color:#31756d; font-size:12px; line-height:20px;">The compensation has been added directly to each instance's current service period. No payment or other action is required. All times are shown in UTC.</td></tr></table>
{/block}

@ -1,5 +1,5 @@
<!doctype html>
<html lang="{if !empty($language) && $language == 'true'}en{else}zh-CN{/if}" xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -87,10 +87,10 @@
</tr>
<tr>
<td class="email-footer" bgcolor="#f5f8fb" style="padding:22px 32px 30px; background-color:#f5f8fb; text-align:center;">
<p style="margin:0 0 6px; color:#7f8da0; font-size:12px; line-height:19px;">{if !empty($language) && $language == 'true'}This is an automated message. Please do not reply.{else}此邮件由系统自动发送,请勿直接回复。{/if}</p>
<p style="margin:0 0 6px; color:#7f8da0; font-size:12px; line-height:19px;">This is an automated message. Please do not reply.</p>
<p style="margin:0 0 8px; color:#91a0b1; font-size:11px; line-height:18px;">
<a href="{$config["baseUrl"]|escape:"html"}" style="color:#159da9; font-weight:700; text-decoration:none;">{if !empty($language) && $language == 'true'}Visit{else}访问{/if} {$config["appName"]|escape:"html"}</a>
<span style="padding:0 6px; color:#c5ced8;">·</span>{if !empty($language) && $language == 'true'}Cloud control panel{else}云资源控制台{/if}
<a href="{$config["baseUrl"]|escape:"html"}" style="color:#159da9; font-weight:700; text-decoration:none;">Visit {$config["appName"]|escape:"html"}</a>
<span style="padding:0 6px; color:#c5ced8;">·</span>Cloud control panel
</p>
<p style="margin:0; color:#a5b0bd; font-size:10px; line-height:17px;">&copy; 2026 {$config["appName"]|escape:"html"}. All rights reserved.</p>
</td>

@ -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,17 +1,17 @@
{extends file='layout.tpl'}
{block name='email_title'}服务地址通知 | {$config["appName"]|escape:"html"}{/block}
{block name='preheader'}请使用最新的站点地址访问控制台。{/block}
{block name='email_title'}Service address notice{/block}
{block name='preheader'}Use the current site address to access 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;">SERVICE NOTICE</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>
{if !empty($user)}<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">您好,{$user->user_name|default:'用户'|escape:"html"}:</p>{/if}
<p class="email-copy" style="margin:0 0 20px; 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;">Service address notice</h1>
{if !empty($user)}<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">Hello {$user->user_name|default:'User'|escape:"html"},</p>{/if}
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">Use the site address below to access the service. Check the browser address bar carefully to avoid unofficial pages.</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 22px;">
<tr><td class="email-panel" bgcolor="#eaf8f8" style="padding:17px 18px; background-color:#eaf8f8; border-radius:11px; color:#235264; font-size:13px; line-height:22px; word-break:break-all;"><span style="display:block; margin-bottom:4px; color:#6b8490; font-size:10px; line-height:15px; font-weight:800; letter-spacing:1px;">CURRENT SITE ADDRESS</span><a href="{$config["baseUrl"]|escape:"html"}" style="color:#0f8f9a; font-weight:800; text-decoration:none; word-break:break-all;">{$config["baseUrl"]|escape:"html"}</a></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 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>
<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 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;">Open control panel</a></td></tr></table>
{/block}

@ -1,16 +1,16 @@
{extends file='layout.tpl'}
{block name='email_title'}{$title|default:'财务通知'|escape:"html"} | {$config["appName"]|escape:"html"}{/block}
{block name='preheader'}您有一条新的财务通知。{/block}
{block name='email_title'}{$title|default:'Billing notice'|escape:"html"}{/block}
{block name='preheader'}You have a new billing notice.{/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;">BILLING NOTICE</p>
<h1 class="email-title" style="margin:0 0 14px; color:#15243a; font-size:28px; line-height:36px; font-weight:800; letter-spacing:-.5px;">{$title|default:'财务通知'|escape:"html"}</h1>
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">您好,{$user->user_name|default:'用户'|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;">{$title|default:'Billing notice'|escape:"html"}</h1>
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">Hello {$user->user_name|default:'User'|escape:"html"},</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 22px;">
<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; word-break:break-word;">{$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; word-break:break-word;">{$text|default:'Sign in to the control panel to review your billing details.'|escape:"html"|nl2br}</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 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>
<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 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 account</a></td></tr></table>
{/block}

@ -1,16 +1,16 @@
{extends file='layout.tpl'}
{block name='email_title'}账户通知 | {$config["appName"]|escape:"html"}{/block}
{block name='preheader'}您有一条来自 {$config["appName"]|escape:"html"} 的账户通知。{/block}
{block name='email_title'}Account notice{/block}
{block name='preheader'}You have a new account notice from {$config["appName"]|escape:"html"}.{/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;">ACCOUNT NOTICE</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;">您好,{$user->user_name|default:'用户'|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;">Account update</h1>
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">Hello {$user->user_name|default:'User'|escape:"html"},</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 22px;">
<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; word-break:break-word;">{$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; word-break:break-word;">{$text|default:'Sign in to the control panel to review the latest account information.'|escape:"html"|nl2br}</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 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>
<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 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;">Open control panel</a></td></tr></table>
{/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,16 +1,16 @@
{extends file='layout.tpl'}
{block name='email_title'}重要提醒 | {$config["appName"]|escape:"html"}{/block}
{block name='preheader'}您有一条需要处理的重要提醒。{/block}
{block name='email_title'}Important notice{/block}
{block name='preheader'}You have an important notice that requires your attention.{/block}
{block name='content'}
<p style="margin:0 0 9px; color:#c5505c; font-size:11px; line-height:16px; font-weight:800; letter-spacing:1.7px;">ACTION REQUIRED</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;">您好,{$user->user_name|default:'用户'|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;">Action required</h1>
<p class="email-copy" style="margin:0 0 20px; color:#53647a; font-size:15px; line-height:25px;">Hello {$user->user_name|default:'User'|escape:"html"},</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; margin:0 0 22px;">
<tr><td class="email-panel" bgcolor="#fff1f3" style="padding:17px 18px; background-color:#fff1f3; border-radius:11px; color:#753c43; font-size:14px; line-height:23px; word-break:break-word;">{$text|default:'请登录控制台查看并处理。'|escape:"html"|nl2br}</td></tr>
<tr><td class="email-panel" bgcolor="#fff1f3" style="padding:17px 18px; background-color:#fff1f3; border-radius:11px; color:#753c43; font-size:14px; line-height:23px; word-break:break-word;">{$text|default:'Sign in to the control panel to review and resolve this notice.'|escape:"html"|nl2br}</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 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>
<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 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 details</a></td></tr></table>
{/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}

@ -52,7 +52,6 @@ return [
$entry('auth.login.verify.email_limited', 'auth', 'auth.login', '此邮箱已请求太多次。', 'warning'),
$entry('auth.login.verify.send_failed', 'auth', 'auth.login', '验证码发送失败,请稍后重试。', 'warning'),
$entry('auth.login.verify.sent', 'auth', 'auth.login', '验证码发送成功,请检查邮箱。', 'status'),
$entry('auth.login.verify.subject', 'auth', 'auth.login', '{site} - 登录安全验证', 'label', ['site' => 'string']),
$entry('auth.register.title', 'auth', 'auth.register', '注册', 'title'),
$entry('auth.register.eyebrow', 'auth', 'auth.register', '创建账户'),
$entry('auth.register.heading', 'auth', 'auth.register', '注册新账户', 'title'),
@ -78,7 +77,6 @@ return [
$entry('auth.register.error.email_registered', 'auth', 'auth.register', '该邮箱地址已被注册。', 'warning'),
$entry('auth.register.verify.sent', 'auth', 'auth.register', '验证码发送成功,请检查邮箱;如果未收到,请检查垃圾箱。', 'status'),
$entry('auth.register.verify.disabled', 'auth', 'auth.register', '邮箱验证码已关闭。', 'notice'),
$entry('auth.register.verify.subject', 'auth', 'auth.register', '{site} - 注册邮箱验证', 'label', ['site' => 'string']),
$entry('auth.register.error.identity', 'auth', 'auth.register', '请填写有效的用户名和邮箱。', 'warning'),
$entry('auth.register.error.email_not_allowed', 'auth', 'auth.register', '此邮箱暂不允许注册。', 'warning'),
$entry('auth.register.error.email_code', 'auth', 'auth.register', '邮箱验证码错误或已过期。', 'warning'),

@ -208,8 +208,8 @@ namespace {
&& (Mail::$messages[0]['emailType'] ?? null) === 'cloud_renewal_invoice'
&& (Mail::$messages[0]['data']['payment_deadline_at'] ?? null)
=== date('Y-m-d H:i:s', $now + 4 * 86400)
&& str_contains((string) (Mail::$messages[0]['subject'] ?? ''),
'实例续费账单已生成'),
&& (string) (Mail::$messages[0]['subject'] ?? '')
=== 'Renewal Invoice Created',
'An open automatic renewal bill was not delivered and marked sent.');
$provisionedInstance = $newInstance(1, 'ready-vm', '8.8.8.11');
@ -236,7 +236,8 @@ namespace {
$provisionMessage = Mail::$messages[1] ?? [];
$assert(($provisionMessage['template'] ?? null) === 'cloud/provision-success.tpl'
&& ($provisionMessage['emailType'] ?? null) === 'cloud_provision_success'
&& str_contains((string) ($provisionMessage['subject'] ?? ''), '实例开通成功')
&& (string) ($provisionMessage['subject'] ?? '')
=== 'Instance Provisioned'
&& ($provisionMessage['data']['instance_name'] ?? null) === 'ready-vm'
&& ($provisionMessage['data']['public_ip'] ?? null) === '8.8.8.11'
&& !array_key_exists('root_password', $provisionMessage['data'] ?? [])

@ -19,6 +19,14 @@ namespace App\Models {
}
namespace App\Services {
class SiteName
{
public static function defaultName(): string
{
return 'Test site';
}
}
class Config
{
public static array $values = [
@ -146,6 +154,7 @@ namespace {
$_SERVER['HTTP_HOST'] = 'site.example.test';
require dirname(__DIR__) . '/app/Services/Mail/Base.php';
require dirname(__DIR__) . '/app/Services/MailSenderIdentity.php';
require dirname(__DIR__) . '/app/Services/Mail/Smtp.php';
require dirname(__DIR__) . '/app/Services/Mail/NullMail.php';
require dirname(__DIR__) . '/app/Services/Mail.php';

@ -9,6 +9,7 @@ $assert = static function ($condition, string $message): void {
$auth = file_get_contents($root . '/app/Controllers/AuthController.php');
$password = file_get_contents($root . '/app/Services/Password.php');
$mailService = file_get_contents($root . '/app/Services/Mail.php');
$invoices = file_get_contents($root . '/app/Services/Cloud/CloudInvoiceService.php');
$worker = file_get_contents($root . '/app/Services/Cloud/CloudWorkerService.php');
$layout = file_get_contents($root . '/resources/email/layout.tpl');
@ -41,6 +42,11 @@ $assert(str_contains($auth, '"scene" => "registration"')
$assert(str_contains($password, '"expire" => date(')
&& str_contains($password, '$expiresAt = $now + 3600 * 24;'),
'Password reset email does not receive its real expiry timestamp.');
$assert(str_contains(
$mailService,
"\$publicConfig['appName'] = MailSenderIdentity::displayName();"
),
'Email templates do not use the same default-title identity as the sender.');
foreach ($contentTemplates as $path => $template) {
$assert(str_contains($template, "{extends file='layout.tpl'}"),
@ -48,6 +54,11 @@ foreach ($contentTemplates as $path => $template) {
}
$assert(count($contentTemplates) === 15,
'Expected every one of the 15 content email templates to be covered.');
$assert(preg_match(
'/[\x{3400}-\x{9fff}]/u',
$layout . implode("\n", $contentTemplates)
) !== 1,
'A system email template still contains non-English static copy.');
foreach (['#edf3f8', '#102235', '#159da9', '#15243a', '#f5f8fb'] as $color) {
$assert(str_contains(strtolower($layout), $color),
'Shared email layout is missing a user-panel theme color: ' . $color);
@ -64,7 +75,7 @@ $assert(str_contains($layout, '@media only screen and (max-width: 620px)')
'Shared email layout lost its mobile responsive rules.');
$assert(str_contains($layout,
'&copy; 2026 {$config["appName"]|escape:"html"}. All rights reserved.')
&& strrpos($layout, '&copy; 2026') > strrpos($layout, '云资源控制台'),
&& strrpos($layout, '&copy; 2026') > strrpos($layout, 'Cloud control panel'),
'Shared email footer is missing the final dynamic copyright line.');
$assert(preg_match('/border(?:-(?:top|right|bottom|left))?\s*:\s*[1-9]/i',
$layout . implode("\n", $contentTemplates)) !== 1,
@ -103,8 +114,8 @@ $assert(str_contains($maintenance, '{foreach $instances as $instance}')
&& str_contains($maintenance, '{$instance.name|escape:"html"}')
&& str_contains($maintenance, '{$instance.ipv4|default:\'—\'|escape:"html"}')
&& str_contains($maintenance, '{$instance.ipv6|default:\'—\'|escape:"html"}')
&& str_contains($maintenance, '开始时间(UTC)')
&& str_contains($maintenance, '结束时间(UTC)'),
&& str_contains($maintenance, 'Start time (UTC)')
&& str_contains($maintenance, 'End time (UTC)'),
'Maintenance email lost its escaped instance list or UTC window.');
foreach (['reason_text', 'compensation_duration',
'incident_window_utc'] as $field) {
@ -113,7 +124,7 @@ foreach (['reason_text', 'compensation_duration',
}
$assert(str_contains(
$compensation,
'{$scope_label|default:\'实例服务\'|escape:"html"}'
'{$scope_label|default:\'Instance service\'|escape:"html"}'
)
&& str_contains($compensation, '{foreach $instances as $instance}')
&& str_contains(
@ -128,7 +139,7 @@ $assert(str_contains(
$compensation,
'{$instance.new_expires_utc|escape:"html"}'
)
&& str_contains($compensation, '时间统一使用 UTC'),
&& str_contains($compensation, 'All times are shown in UTC'),
'Compensation email lost its escaped instance list or UTC contract.');
foreach (['root_password', 'private_key', 'sealed_credential',
'generated_password'] as $secret) {

@ -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;

@ -153,23 +153,23 @@ try {
'@media only screen and (max-width: 620px)'),
'A rendered email lost its shared theme, responsive CSS or footer.');
}
$assert(str_contains($registration, '验证您的注册邮箱')
$assert(str_contains($registration, 'Verify your email address')
&& str_contains($registration, '12&lt;345')
&& str_contains($login, 'Confirm your sign-in')
&& str_contains($emailChange, '确认修改邮箱')
&& str_contains($emailChange, '验证此新邮箱后再将其设为登录邮箱')
&& str_contains($emailChange, 'Confirm your email change')
&& str_contains($emailChange, 'verify this new email address')
&& str_contains($emailChange, '246810'),
'Registration, login or email-change verification rendered the wrong scene.');
$assert(str_contains($reset, '重置账户密码')
$assert(str_contains($reset, 'Reset your password')
&& str_contains($reset, '&lt;unsafe&gt;')
&& str_contains($reset, '&amp;x=1'),
'Password-reset email did not render or escape its secure URL.');
$assert(str_contains($renewal, '续费账单已生成')
$assert(str_contains($renewal, 'Renewal invoice created')
&& str_contains($renewal, '&lt;script&gt;')
&& str_contains($renewal, '#42')
&& str_contains($renewal, '2026-10-08 18:00:00'),
'Renewal invoice email did not render its safe public details.');
$assert(str_contains($provisioned, '实例已开通')
$assert(str_contains($provisioned, 'Your instance is ready')
&& str_contains($provisioned, '&lt;script&gt;')
&& str_contains($provisioned, '203.0.113.43')
&& !str_contains($provisioned, 'not-for-email'),
@ -183,25 +183,26 @@ try {
&& str_contains($maintenance, '2001:db8::10')
&& str_contains($maintenance, '2026-11-06 03:00:00 UTC'),
'Maintenance email did not escape content or render its UTC scope.');
$assert(str_contains($compensation, '实例可用时间补偿已到账')
$assert(str_contains($compensation, 'Service time compensation applied')
&& str_contains($compensation, '网络 &lt;故障&gt;')
&& !str_contains($compensation, '<故障>')
&& str_contains($compensation, 'HKG-A &amp; IPv4 pool')
&& str_contains($compensation, 'vm-&lt;one&gt;')
&& str_contains($compensation, '2026-12-01 02:00:00 UTC'),
'Compensation email did not escape its frozen result.');
$assert(str_contains($ticketCreated, '工单已提交')
&& str_contains($ticketReplied, '工单收到回复')
$assert(str_contains($ticketCreated, 'Ticket submitted')
&& str_contains($ticketReplied, 'Ticket reply received')
&& str_contains($ticketCreated, '网络 &lt;异常&gt; &amp; 排查'),
'Ticket emails did not render their escaped shared content.');
$assert(str_contains($backup, '数据库备份已完成')
&& str_contains($backup, 'Database backup completed')
&& str_contains($monitor, '&lt;script&gt;alert(&quot;notice&quot;)&lt;/script&gt;')
&& !str_contains($monitor, '<script>')
&& str_contains($warning, '重要提醒')
&& str_contains($warning, 'Action required')
&& str_contains($finance, '余额 &lt;提醒&gt;')
&& str_contains($addressNotice, 'https://cloud.example.test')
&& str_contains($newYear, '新年专享优惠')
&& str_contains($testMail, '邮件服务连接正常'),
&& str_contains($newYear, 'New Year offer')
&& str_contains($testMail, 'Email delivery is working'),
'A legacy or test email did not migrate safely to the shared layout.');
} finally {
$generatedFiles = new RecursiveIteratorIterator(

@ -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;
}

@ -66,11 +66,22 @@ namespace PHPMailer\PHPMailer {
}
}
namespace App\Services {
class SiteName
{
public static function defaultName(): string
{
return "Default Site\r\nInjected";
}
}
}
namespace {
use App\Services\Mail\Smtp;
use PHPMailer\PHPMailer\PHPMailer;
require dirname(__DIR__) . '/app/Services/Config.php';
require dirname(__DIR__) . '/app/Services/MailSenderIdentity.php';
require dirname(__DIR__) . '/app/Services/Mail/Base.php';
require dirname(__DIR__) . '/app/Services/Mail/Smtp.php';
@ -114,7 +125,7 @@ namespace {
'SMTP transport timeouts are not bounded for ' . $address);
expectSmtpSingleConfig($mail->SMTPSecure === 'tls', 'Wrong SMTP encryption for ' . $address);
expectSmtpSingleConfig($mail->fromAddress === 'sender@primary.example.com', 'Wrong sender address for ' . $address);
expectSmtpSingleConfig($mail->fromName === 'Primary sender', 'Wrong sender name for ' . $address);
expectSmtpSingleConfig($mail->fromName === 'Default Site Injected', 'Wrong sender name for ' . $address);
expectSmtpSingleConfig($mail->addresses === [$address], 'Wrong recipient for ' . $address);
}
@ -136,6 +147,10 @@ namespace {
$source = file_get_contents(dirname(__DIR__) . '/app/Services/Mail/Smtp.php');
expectSmtpSingleConfig($source !== false && strpos($source, 'gmail_smtp_') === false, 'SMTP still reads obsolete gmail_smtp_* settings.');
expectSmtpSingleConfig(strpos($source, "Config::get('smtp_name')") === false, 'SMTP still uses smtp_name instead of the site default title.');
$example = file_get_contents(dirname(__DIR__) . '/config/.config.php.example');
expectSmtpSingleConfig(is_string($example) && strpos($example, "['smtp_name']") === false,
'The example configuration still advertises the retired smtp_name setting.');
echo 'SMTP single-configuration checks passed.' . PHP_EOL;
}

@ -44,7 +44,7 @@ $surfaceCounts = array_count_values(array_column(
ksort($surfaceCounts, SORT_STRING);
$assert($surfaceCounts === [
'accessibility' => 102,
'admin' => 112,
'admin' => 110,
'dialog' => 56,
'feedback' => 610,
'page' => 1470,
@ -125,7 +125,7 @@ $authAdminCount = count(array_filter(
true
) && $entry['editor_surface'] === 'admin'
));
$assert($authAdminCount === 46,
$assert($authAdminCount === 44,
'Guest-only authentication page copy is not fully administrator-owned.');
foreach (['common.action.refresh', 'common.action.load_more'] as $copyKey) {
$assert($loadedEntries[$copyKey]['editor_surface'] === 'shared'

Loading…
Cancel
Save