Compare commits

..
Author SHA1 Message Date
hellcat 8642c1be7f docs(hn): record full mail theme activation and real inbox acceptance
Docker Build and Publish / build (push) Has been cancelled
2026-11-01 19:32:39 +08:00
hellcat 2a82819ce8 feat(hn): cover all transactional mail and incoming auto replies
Docker Build and Publish / build (push) Waiting to run
2026-11-01 18:39:44 +08:00
hellcat 97da1ae43a design(hn): add branded transactional email previews 2026-11-01 18:28:40 +08:00
hellcat 8c1a01ab3b docs(payments): record cashier fix rollout and WeChat recovery
Docker Build and Publish / build (push) Waiting to run
2026-11-01 16:40:46 +08:00
hellcat 296e063e3c fix(payments): accept HTML cashiers and recognize WeChat HTTPS QR links
Docker Build and Publish / build (push) Waiting to run
2026-11-01 16:31:14 +08:00
18 changed files with 369 additions and 3 deletions

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ class AutoReplyService
$outHeaders['In-Reply-To'] = $headers['message-id'];
$outHeaders['References'] = $headers['message-id'];
}
$html = view('mail.default.notify', array_replace([
$html = view(config('mailflow.auto_reply_view', 'mail.default.notify'), array_replace([
'name' => admin_setting('app_name', 'dpl'), 'url' => admin_setting('app_url', config('app.url')),
'content' => e((string) Settings::get('auto_reply_text')),
], Branding::values()))->render();
@@ -9,7 +9,7 @@ class HttpsTransport
public function request(string $method,string $url,array $fields=[],bool $downstream=false): array
{
[$host,$ip]=$this->endpoint($url,$downstream);
$client=Http::withoutRedirecting()->connectTimeout(10)->timeout(25)->withUserAgent('XB-PaymentHealth/1.0')
$client=Http::withoutRedirecting()->connectTimeout(10)->timeout(25)->withUserAgent('XB-PaymentHealth/1.0')->accept('text/html')
->withOptions(['verify'=>true,'curl'=>[CURLOPT_RESOLVE=>[$host.':443:'.(str_contains($ip,':')?'['.$ip.']':$ip)]]]);
$response=$method==='POST'?$client->asForm()->post($url,$fields):$client->get($url);
$body=$response->body();if(strlen($body)>2097152)throw new RuntimeException('oversized_cashier_response');
+12 -1
View File
@@ -11,7 +11,18 @@ class QrEvidence
|| preg_match('/(?:money|amount|price)["\x27\s:=]+'.preg_quote($amount,'/').'(?![0-9.])/i',$html);
if(!$amountSeen)return false;
$uri=$type==='wxpay'?'(?:wxpay:\/\/|weixin:\/\/wxpay\/)':'(?:alipays:\/\/|https:\/\/qr\.alipay\.com\/)';
if(!preg_match('~'.$uri.'[^\s"\x27<>]+~i',$html))return false;
$paymentUriSeen=(bool)preg_match('~'.$uri.'[^\s"\x27<>]+~i',$html);
// This provider renders WeChat QR codes as an HTTPS short link. Inspect the
// complete URL so lookalike hosts or a URL embedded in another URL fail.
if(!$paymentUriSeen&&$type==='wxpay'&&preg_match_all('~https://[^\s"\x27<>\\\\]+~i',html_entity_decode($html,ENT_QUOTES|ENT_HTML5),$links)){
foreach($links[0] as $link){
$parts=parse_url($link);
if($parts!==false&&strtolower($parts['scheme']??'')==='https'&&strtolower($parts['host']??'')==='wxmpurl.cn'
&&!isset($parts['user'])&&!isset($parts['pass'])&&!isset($parts['port'])&&!isset($parts['fragment'])
&&($parts['path']??'/')!=='/'){$paymentUriSeen=true;break;}
}
}
if(!$paymentUriSeen)return false;
// Structured rendering of a real payment URI, or a QR bitmap with three finder patterns.
if(preg_match('~(?:new\s+QRCode|\.qrcode\s*\(|QRCode\.to(?:Canvas|DataURL|String))~i',$html))return true;
if(preg_match_all('~data:image/png;base64,([A-Za-z0-9+/=]+)~',$html,$matches))foreach($matches[1]as$data){
+2
View File
@@ -17,6 +17,8 @@ return [
'imap_password' => env('MAIL_IMAP_PASSWORD'),
'imap_folder' => 'INBOX',
'auto_reply_enabled' => false,
// An instance may brand incoming-mail replies without changing shared defaults.
'auto_reply_view' => env('MAIL_AUTO_REPLY_VIEW', 'mail.default.notify'),
'auto_reply_subject' => '我们已收到您的邮件',
'auto_reply_text' => '您的邮件已收到,我们会尽快处理。',
'report_enabled' => env('MAIL_REPORT_ENABLED', false),
+2
View File
@@ -26,6 +26,8 @@
## HN 邮件运行配置
HN六类普通邮件及来信自动回复已正式统一为独立HN样式,真实收件与启用/回退见[邮件主题](HN_MAIL_THEME.md);DPL模板与配置保持原样。
`/www/wwwroot/hardnerd.net/.env`、HN库的 `mail_flow` 设置;SMTP465 SSL与IMAP993 TLS均校验证书。旧Laravel读取 `MAIL_DRIVER`,已明确设smtp,不能只设MAIL_MAILER。发件名称hardnerd、地址及Reply-To均为自有邮箱,页脚主站hardnerd.net,空MAIL_LOGO_PATH避免沿用DPL图片。
验证码/登录链接/工单回复优先Resend,其他走企业SMTP;额度100/3000且使用官方用量与本地预占,规则沿 [BUSINESS_RULES](BUSINESS_RULES.md)。Resend密钥、IMAP密码与回调签名秘密在HN库加密;SMTP密码只在私有环境,未复制进普通后台可读设置。ACC-HN-MAIL与ACC-RESEND-HN私有字段按GemDocs读取,本文不存值。
+50
View File
@@ -0,0 +1,50 @@
# HN 邮件主题
## 当前状态
2026-11-01用户明确批准“补齐并正式启用HN”后,已在sitejp02 HN实例启用全部六类普通邮件及来信自动回复,统一HN Logo、深灰底与绿色样式。本地HN也已同步六类模板及Logo/自动回复视图,保持本地mailflow关闭,没有本地真实发信或收件任务。DPL的环境、配置缓存、数据库模板、邮件设置、支付与用户订单基线均未改。
功能提交 `2a82819ce8ddb46625ee5a9e2f811d32449a58e2`;初稿设计提交97da1ae。已提交推送master、codex/hn-mail-design、codex/xb-unified-20261031,生产共用/www/wwwroot/xb/current从8c1a01a Git快进,保留原并行Stellar模板。此前“仅预览、尚未启用”为历史阶段。
## 覆盖范围与实现
| 源文件 | 用途 | 业务变量/备注 |
| --- | --- | --- |
| `resources/mail/hn/verify.html` | 邮箱验证码 | code;注册/找回等共用验证入口 |
| `resources/mail/hn/mailLogin.html` | 邮件登录 | link |
| `resources/mail/hn/notify.html` | 站点通知、工单回复、群发、管理员测试 | content;各用途原邮件标题保留 |
| `resources/mail/hn/remindExpire.html` | 订阅即将到期 | 24小时提醒语义保留 |
| `resources/mail/hn/serviceExpired.html` | 套餐已到期 | 档位及资格限制保留 |
| `resources/mail/hn/remindTraffic.html` | 流量提醒 | 80%提醒语义保留 |
| `resources/views/mail/hn/autoReply.blade.php` | 真实来信自动回复 | 原回复正文、当前网站地址与访问按钮 |
六份普通HTML通过HN独立v2_mail_templates覆盖,subject有意置空,使用现有MailService回退以保留验证码、工单及群发等各自业务标题;对应mail_template缓存已逐名清理。不新增数据库结构或邮件API,不复制其他实例数据/密钥。
本次获批核心仅两处:AutoReplyService按配置选择视图;config/mailflow.php新增MAIL_AUTO_REPLY_VIEW,默认mail.default.notify。HN环境单独设mail.hn.autoReply,DPL未配置时继续原默认视图,包括旧配置缓存兼容回退。原自动回复开启状态、正文、主题、北京时间每发件人每日一次、按父记录去重、退信/自动邮件过滤、原收件游标及回信头均保持。
HN单独MAIL_LOGO_PATH指向resources/mail/hn/logo.png;PNG由现有public/brand/hn/logo.svg无修改渲染为128px,展示44px。CID `site-logo@dpl` 仅是既有传输内部兼容标识,实际图片和可见品牌为HN。主题深灰底#111518、内容卡#1E242A、绿色#B4F047,单列600px表格、内联样式与480px窄屏样式,无远程图片/字体、脚本或追踪像素。
## 测试与真实收件验收
邮件全套、共享实例及管理员套餐回归87项504断言通过;包括六类经MailService实际渲染、业务标题保留、文字转义、PNG附件、HN自动回复选择、DPL默认兼容及防循环/按日去重。自动回复正文新增动态站点地址后,两项相关选择/转义回归再次通过。
用户指定的当前Proton账号已由页面账号标识核对,具体私人收件地址仅保留私有回执,不复制到普通Git。真实验收:
- 初稿通知:HN MailMessage7,SMTP submitted,Proton已收到并打开。
- 初稿验证码:第一次测试键含点号导致Resend HTTP422(8,failed、无provider_id);仅修正测试键后9经Resend submitted并收到。服务商字段限制见[官方规范](https://github.com/resend/resend-openapi/blob/main/resend.yaml)。旧失败记录保留,不重发通知,不改核心。
- 正式启用后,邮件登录12、即将到期13、已到期14、流量提醒15,均经MailService选择db:对应模板,原测试标题保留、SMTP submitted;四封均在Proton收到并打开,标题、Logo、正文与按钮显示核对通过。测试不创建真实验证码或登录凭证,不变更真实用户套餐。
- 用户批准的一封Proton来信,已在已发送确认,HN IMAP INBOX UID4/UIDVALIDITY1793103379正常入库16;AutoReplyService生成17,原Horizon经SMTP提交一次并在Proton收到、打开,HN Logo、新样式及动态https://hardnerd.net地址显示通过。日去重仍为1,无重复回信。
最初按完整主题查询未匹配该来信,不能据此认定漏收;随后用IMAP唯一键确认原信和回复均已正常处理。中间一次既有带锁轮询返回0;未重新发送来信、回退游标、重扫历史、改反垃圾规则或手动补造入站记录。
本轮实际收件覆盖六类模板及独立自动回复。工单/群发复用notify,并通过六模板真实渲染回归核对,不为验收创建客户工单或给真实客户群发。Proton桌面显示已验收,不扩大为所有客户端/手机或真实用户订阅到期触发验收。本机仅访问用户指定第三方邮箱,未访问HN/DPL项目线上页面。
## 发布、备份与运行
私有备份:sitejp02 `/root/codex-backups/hn-mail-theme/20261101-full/`,目录700、私密副本600;保存两实例原环境/配置缓存、HN原模板、变更源文件、版本、Git差异、启用与实发回执。初稿试发回执另存 `/root/codex-backups/hn-mail-design/20261101-v1/`。本地HN备份在忽略目录codex/output/hn-mail-design-20261101/local-private-backup/,不提交Git。
仅HN配置缓存按hn身份重建;定点刷新相关OPcache,不做全局重启。HN Horizon正常终止后,现有systemd Restart=on-failure不会自动拉起成功退出的进程;已显式start并核对HN/DPL Horizon及php8.4-fpm均active,未修改Restart策略。后续优雅重载必须按实际Restart策略核对并显式启动,不能只执行horizon:terminate就声称已恢复。
## 回退
仅恢复HN六个指定模板名的原记录,不能整表覆盖随后新增配置;逐名清理mail_template缓存。仅将HN MAIL_AUTO_REPLY_VIEW、MAIL_LOGO_PATH恢复为发布前值/缺省状态,重建仅HN配置缓存并按上述策略重载HN队列。保留所有已发送/入站/投递记录与IMAP游标,不删除事件或重发历史邮件。DPL配置与模板不参与回退;需要代码回退时只回退本任务相关改动,保留并行提交与Stellar本地差异。原MAIL_DRIVER、SMTP/IMAP、Resend及邮件档位均未变。
+34
View File
@@ -105,3 +105,37 @@ FUC只读聚合验证:生产当前启用epay,最近30日非管理员EPay WeC
19:47:35 +08:00原HN支付宝单已过期,严格拒绝恢复。用户随后明确追加授权仅一笔HN支付宝32元待支付测试单、不付款并在成功后恢复HN支付宝。19:51:29生产原EPay插件和已修复EpayProbe实际运行:网关仅POST一次,随后q.fenjingwl.cn GET HTTP200,fresh_cashier_qr、32元/支付URI/二维码严格验证通过,未误跟到授权登录页。随后只恢复HN支付宝,核对通道身份/配置与有效监测归属,在事务清除归属、保留原slot与每日预算;微信仍关闭。没有新增应用用户/订单、扫码或付款,商户平台有这一笔待支付记录。证据ali-fresh-claim/probe、私有请求/响应与ali-recovery.json均在本批备份目录。HN恢复通知使用稳定事件键经既有TeleHub调用方发送,初次回执queued,随后仅查询该回执确认sent;未重复投递。DPL开关/状态未人工修改,下一自然检测2026-11-01 00:00可用新检测结果自行恢复。微信故障仍未修通,需继续核对商户实际子通道路由;已有同单404证据可交支付平台,尚未对外发送。
本批共59项隔离测试258断言通过;已完成服务器侧发布验收,未做线上页面验收,未扫码、付款或验证到账。二维码漏判、告警文案与HN支付宝收银验收/恢复已完成;微信收银仍未修通,不把代码发布或收银通过写为实际付款/到账成功。
## 2026-11-01 FUC与HN微信对照:两处检测误判已定位
诊断已完成;用户在解释两项具体修复后明确“弄”,批准本轮核心实现、测试及HN/DPL发布。发布前复核生产HEAD为f825c30038723c0c7d5ea0aadc0ce9286f3edc7e;当时HN/DPL支付宝1、微信2均关闭且具有有效监测归属,最近自动结果为12:00 cashier_not_found,每实例当日预算6。保留生产并行Stellar修改和所有自动账本,不以昨日支付宝恢复记录代替当前状态。
FUC生产只读数据及支付商后台已确认今日普通用户微信成功记录(50元/15元),其中15元单已支付且通知成功。FUC成功单与XB未付微信探测均为channel8/subchannel0/version0;当前随机HMAC比较确认网关、商户号、密钥、MD5一致。不能将差异归因为不同商户、管理员捷径或submit.php/mapi.php本身。
用户明确批准最多3笔HN微信待支付对照单、不付款。15:57:56至15:58:00已执行全部3笔:32元原32位格式、32元8位短格式、16元8位短格式,各仅一次mapi请求取得支付商成功返回,随后旧检测传输的收银POST均404,响应为相同通用404页面。因此格式或金额不是这次404的充分解释。三笔已用完授权;没有新增FUC/DPL应用订单或修改商户配置,没有扫码或付款;应用用户/订单计数、通道和自动状态保持。私有完整请求/响应保存在sitejp02的/root/codex-backups/xb-payment-health/manual-20261101-format-matrix-1/,不得复跑矩阵创建新单。
对上述同一批现有订单进行浏览器收银检查,16元短格式与32元长格式都显示正确金额和微信二维码。捕获浏览器实际POST与服务器原POST逐字段及编码字节比较均相同,目标IP亦相同。继续在同一生产HN服务器、同一32元订单、HTTP/1.1和原XB-PaymentHealth/1.0 User-Agent下控制变量:原请求404;仅添加Accept: text/html后200,出现32.00、二维码渲染器及支付链接;最后验证时间16:14:42 +08。未创建新订单。这定位HttpsTransport缺少HTML Accept头,不推断服务商故意拦截或某种WAF策略。
另一独立误判:QrEvidence只接受原生wxpay/weixin URI,实际收银页二维码内容为HTTPS wxmpurl.cn链接。对实际渲染的230px二维码截图使用ZXing离线解码,确认QR Code/valid=true、HTTPS、精确主机wxmpurl.cn;当前检测器仍返回false。二维码未展示、扫码或打开实际付款URI,此证据仅证明收银二维码可用,未完成资金支付或到账验收。脱敏解码结果位于codex/output/payment-format-diagnosis-20261101/browser-qr-decode-redacted.json。
本轮最小核心修复:HttpsTransport添加Accept: text/html;QrEvidence仅在微信分支识别精确HTTPS wxmpurl.cn支付链接,同时保持金额、二维码渲染/定位图案和现有TLS/公网DNS/SSRF校验,不泛化接受任意HTTPS链接、不请求二维码URL。回归覆盖请求头、真实页面形状的合成夹具、恶意相似主机、错误金额、无二维码、旧订单回调及人工停用归属。提交/推送/Git部署到HN/DPL和监测归属恢复已获本轮批准;支付宝须另有有效收银证据,不能用微信证明恢复。
旧Oct31订单被服务商改回调域名而提示“支付参数有变化”,该证据被排除出本轮控制变量结论。Windows经登记FUC反代仅做只读首页HTTP200,不声称FUC浏览器购买流程验收;服务商验证码由用户完成,VNC/RDP管理员会话发生切换后停止桌面输入。此次本机只访问第三方支付收银台,未访问本机禁访的项目线上入口;测试收银台已关闭以停止状态轮询。
### 本轮批准与实现验收
批准范围仅HttpsTransport的HTML Accept、QrEvidence的精确HTTPS wxmpurl.cn识别及相关测试/文档/Git发布。实际实现解析完整URL,拒绝子域、后缀相似主机、用户信息、显式端口、片段及嵌入其他URL的伪装;维持原User-Agent,不改变支付插件、签名、回调、数据库结构或每6小时调度。检测不访问二维码链接。
支付/EPay/回调隔离测试36项180断言通过,涵盖人工停用、监测归属及既有有效回调。发布前合入生产f825c30038723c0c7d5ea0aadc0ce9286f3edc7e,保留已发布付款汇报。共享主题/管理员套餐/注册及付款汇报隔离回归52项196断言通过;与支付回归共88项376断言。共享vendor的工作树测试引导已在忽略目录明确APP_BASE_PATH及App/Tests类路径,未改业务代码或依赖。未实际付款。
### 2026-11-01 16:39 两实例发布与微信恢复
功能提交296e063e3cb3235e4cdec2e13fd5081785a5da35已通过白色机原子推送master、codex/payment-health、codex/xb-unified-20261031,并将sitejp02共用/www/wwwroot/xb/current从f825c30038723c0c7d5ea0aadc0ce9286f3edc7e Git快进到该提交。中继原远端三分支停留18913a1,首次增量缺生产基线而拒绝导入;核对origin确为/tom/dpl.git后,改传从已知18913a1开始的24KB完整增量链,验证祖先后正常快进推送;无强推、打包覆盖或回退并行付款汇报。
私有备份/root/codex-backups/xb-payment-health/20261101-html-wxqr-fix/包含发布前明确提交、回退说明、两实例环境和状态、变更源文件、发布与既有单验收回执;目录700、敏感副本600。PHP语法与两实例运行元数据检查通过,FPM/Horizon三服务active;定点OPcache检查均未缓存两类文件,无全局重启。生产原theme/Stellar/dashboard.blade.php并行改动哈希保持。
16:38:52仅POST原HN矩阵long_32同一笔下游签名表单,未再次mapi下单:api.shangri-la.vc返回HTTP200、金额32元、业务错误检测为false、修复后QrEvidence=true。私有响应与existing-order-verification.json保留,应用用户/订单、通道与自动状态在验收请求前后均不变。
16:39:14按批准仅恢复HN/DPL微信2:两站url/pid/key/type在内存精确一致,分别锁定状态、核对有效Ownership及通道revision/updated_at后事务开启,清除监测归属;DPL复用同商户的HN既有单证据,没有DPL新单或独立付款验收。保留人工停用保护、每站当日预算6及原slot;支付宝1仍关闭且监测归属保留,等待自然18:00独立收银检测,不能把微信证据当支付宝验证。
两站各生成一条恢复通知,使用既有TeleHub专用调用方、notification/base和新稳定事件键,初始回执queued;随后只GET查询各自原回执,HN/DPL两条均确认sent,未重复发送历史通知。完整实际支付、微信客户端扫码和到账未验收;本轮修复不涉及前台交互,已完成服务器侧收银验收,未做项目线上页面验收。回退时先关自动控制,再将本轮两类检测实现恢复到发布前明确版本;保留实例配置、已恢复的开关、监测账本和所有并行功能,不能整库或无范围reset。
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>登录确认 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">登录确认 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">登录确认</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">点击下方按钮登录 HardNerd,链接有效期为 5 分钟。</p><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#B4F047" style="background-color:#B4F047;border-radius:6px;text-align:center;mso-padding-alt:14px 28px;"><a href="{{link}}" style="display:inline-block;padding:14px 28px;border:1px solid #B4F047;border-radius:6px;background-color:#B4F047;color:#141A12;font-size:15px;line-height:22px;font-weight:700;text-decoration:none;">确认登录</a></td></tr></table><p style="margin:22px 0 0;color:#939CA6;font-size:12px;line-height:21px;">如非本人操作,请忽略此邮件。请勿将登录链接转发给他人。</p><p style="margin:22px 0 0;color:#939CA6;font-size:12px;line-height:21px;">按钮无法打开时,可复制此链接到浏览器:<br><a href="{{link}}" style="color:#B4F047;text-decoration:underline;word-break:break-all;">{{link}}</a></p>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{site_url|https://hardnerd.net}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">[email protected]</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
+55
View File
@@ -0,0 +1,55 @@
{
"brand": "hn",
"version": 1,
"status": "production",
"active_by_default": false,
"templates": [
{
"name": "verify",
"subject": "HardNerd · 邮箱验证码",
"file": "verify.html",
"required_vars": [
"code"
]
},
{
"name": "notify",
"subject": "HardNerd · 站点通知",
"file": "notify.html",
"required_vars": [
"content"
]
},
{
"name": "mailLogin",
"subject": "HardNerd · 登录确认",
"file": "mailLogin.html",
"required_vars": [
"link"
]
},
{
"name": "remindExpire",
"subject": "HardNerd · 订阅即将到期",
"file": "remindExpire.html",
"required_vars": []
},
{
"name": "serviceExpired",
"subject": "HardNerd · 套餐已到期",
"file": "serviceExpired.html",
"required_vars": []
},
{
"name": "remindTraffic",
"subject": "HardNerd · 流量使用提醒",
"file": "remindTraffic.html",
"required_vars": []
}
],
"logo": "logo.png",
"logo_content_id": "site-logo@dpl",
"compatibility_note": "Existing mail transport CID retained; image and visible branding are HN only.",
"auto_reply_view": "mail.hn.autoReply",
"activation_scope": "HN instance database templates and environment only"
}
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>站点通知 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">站点通知 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">站点通知</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">{{content}}</p><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#B4F047" style="background-color:#B4F047;border-radius:6px;text-align:center;mso-padding-alt:14px 28px;"><a href="{{url}}" style="display:inline-block;padding:14px 28px;border:1px solid #B4F047;border-radius:6px;background-color:#B4F047;color:#141A12;font-size:15px;line-height:22px;font-weight:700;text-decoration:none;">前往查看</a></td></tr></table>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{site_url|https://hardnerd.net}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">[email protected]</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>订阅即将到期 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">订阅即将到期 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">订阅即将到期</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">您的订阅服务将在 <strong style="color:#F1F4F0;">24 小时内到期</strong>。</p><p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">为避免服务中断,请及时续费。如已完成续费,请忽略此提醒。</p><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#B4F047" style="background-color:#B4F047;border-radius:6px;text-align:center;mso-padding-alt:14px 28px;"><a href="{{url}}" style="display:inline-block;padding:14px 28px;border:1px solid #B4F047;border-radius:6px;background-color:#B4F047;color:#141A12;font-size:15px;line-height:22px;font-weight:700;text-decoration:none;">管理订阅</a></td></tr></table>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{site_url|https://hardnerd.net}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">[email protected]</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>流量使用提醒 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">流量使用提醒 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">流量使用提醒</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">您的套餐流量已使用 <strong style="color:#F1F4F0;">80%</strong>。</p><p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">请留意剩余流量,您可以在控制台查看详细使用情况。</p><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#B4F047" style="background-color:#B4F047;border-radius:6px;text-align:center;mso-padding-alt:14px 28px;"><a href="{{url}}" style="display:inline-block;padding:14px 28px;border:1px solid #B4F047;border-radius:6px;background-color:#B4F047;color:#141A12;font-size:15px;line-height:22px;font-weight:700;text-decoration:none;">查看用量</a></td></tr></table>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{site_url|https://hardnerd.net}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">[email protected]</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>套餐已到期 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">套餐已到期 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">套餐已到期</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">您的套餐已到期。如需继续使用,请前往网站续费。</p><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#B4F047" style="background-color:#B4F047;border-radius:6px;text-align:center;mso-padding-alt:14px 28px;"><a href="{{url}}" style="display:inline-block;padding:14px 28px;border:1px solid #B4F047;border-radius:6px;background-color:#B4F047;color:#141A12;font-size:15px;line-height:22px;font-weight:700;text-decoration:none;">前往续费</a></td></tr></table>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{site_url|https://hardnerd.net}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">[email protected]</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>邮箱验证码 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">邮箱验证码 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">邮箱验证码</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">请使用以下验证码完成验证。</p><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td bgcolor="#14191D" style="padding:24px 16px;border:1px solid #39442E;border-radius:6px;text-align:center;"><span style="font-family:'Courier New',Courier,monospace;font-size:34px;line-height:44px;letter-spacing:8px;font-weight:700;color:#B4F047;">{{code}}</span></td></tr></table><p style="margin:22px 0 0;color:#939CA6;font-size:12px;line-height:21px;">验证码有效期为 5 分钟,请勿转发或透露给他人。如非本人操作,请忽略此邮件。</p>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{site_url|https://hardnerd.net}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">[email protected]</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><meta name="color-scheme" content="dark"><meta name="supported-color-schemes" content="dark"><title>来信已收到 · HardNerd</title>
<style>@media only screen and (max-width:480px){.hn-shell{width:100%!important}.hn-pad{padding-left:24px!important;padding-right:24px!important}.hn-outer{padding:20px 12px!important}.hn-title{font-size:24px!important;line-height:34px!important}}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}</style></head>
<body bgcolor="#111518" style="margin:0;padding:0;background-color:#111518;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;color:#EDF1F4;-webkit-text-size-adjust:100%;">
<div style="display:none;font-size:1px;color:#111518;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;">来信已收到 · HardNerd 账户与服务邮件</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#111518" style="background-color:#111518;"><tr><td class="hn-outer" align="center" style="padding:40px 16px;">
<!--[if mso]><table role="presentation" width="600" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<table class="hn-shell" role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;table-layout:fixed;">
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:28px 36px;background-color:#1E242A;border:1px solid #353D44;border-bottom:0;border-radius:10px 10px 0 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="48" valign="middle" style="width:48px;padding-right:12px;"><img src="cid:site-logo@dpl" width="44" height="44" alt="HardNerd" style="display:block;width:44px;height:44px;border:0;border-radius:10px;"></td><td valign="middle" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:24px;line-height:30px;letter-spacing:-0.7px;color:#F2F4F1;font-weight:750;">Hard<span style="color:#B4F047;">Nerd</span></td></tr></table>
</td></tr>
<tr><td bgcolor="#1E242A" style="background-color:#1E242A;border-left:1px solid #353D44;border-right:1px solid #353D44;padding:0 36px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td height="1" bgcolor="#39432F" style="height:1px;background-color:#39432F;font-size:0;line-height:0;">&nbsp;</td></tr></table></td></tr>
<tr><td class="hn-pad" bgcolor="#1E242A" style="padding:32px 36px 36px;background-color:#1E242A;border:1px solid #353D44;border-top:0;border-radius:0 0 10px 10px;">
<h1 class="hn-title" style="margin:0 0 20px;font-size:27px;line-height:38px;letter-spacing:-0.4px;font-weight:700;color:#F2F4F1;">来信已收到</h1>
<p style="margin:0 0 18px;color:#C5CBD2;font-size:15px;line-height:26px;word-break:break-word;overflow-wrap:anywhere;">{!! nl2br($content) !!}</p><p style="margin:0 0 22px;color:#C5CBD2;font-size:15px;line-height:26px;">当前网站地址:<br><a href="{{$site_url ?? $url}}" style="color:#B4F047;font-weight:700;text-decoration:none;word-break:break-all;">{{$site_url ?? $url}}</a></p><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#B4F047" style="background-color:#B4F047;border-radius:6px;text-align:center;mso-padding-alt:14px 28px;"><a href="{{$url}}" style="display:inline-block;padding:14px 28px;border:1px solid #B4F047;border-radius:6px;background-color:#B4F047;color:#141A12;font-size:15px;line-height:22px;font-weight:700;text-decoration:none;">访问 HardNerd</a></td></tr></table>
</td></tr>
<tr><td class="hn-pad" align="left" style="padding:22px 36px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',Arial,sans-serif;font-size:12px;line-height:22px;color:#8D979F;">此邮件由 HardNerd 系统发送。<br><a href="{{$site_url ?? 'https://hardnerd.net'}}" style="color:#B4F047;text-decoration:none;">hardnerd.net</a><span style="color:#59636D;">&nbsp;&nbsp;/&nbsp;&nbsp;</span><a href="mailto:[email protected]" style="color:#AAB4BC;text-decoration:none;">mail@hardnerd.dev</a></td></tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>
+49
View File
@@ -256,6 +256,55 @@ class MailFlowTest extends TestCase
$this->assertSame('conventional', $reply->refresh()->channel);
}
public function test_instance_auto_reply_view_uses_hn_brand_and_keeps_escape_headers_and_subject(): void
{
config(['mailflow.auto_reply_enabled'=>true,'mailflow.auto_reply_view'=>'mail.hn.autoReply',
'mailflow.logo_path'=>base_path('resources/mail/hn/logo.png'),
'mailflow.auto_reply_subject'=>'Original reply subject','mailflow.auto_reply_text'=>"Latest address\n<script>not executable</script>"]);
$incoming=MailMessage::create(['message_key'=>'hn-incoming','direction'=>'in','purpose'=>'incoming','email'=>'[email protected]','subject'=>'Help','status'=>'received']);
$reply=app(AutoReplyService::class)->prepare($incoming,['message-id'=>'<[email protected]>']);
$this->assertNotNull($reply);$this->assertSame('Original reply subject',$reply->subject);
$this->assertStringContainsString('Hard<span',$reply->payload['html']);
$this->assertStringContainsString('#B4F047',$reply->payload['html']);
$this->assertStringContainsString('&lt;script&gt;',$reply->payload['html']);
$this->assertStringNotContainsString('<script>',$reply->payload['html']);
$this->assertSame('auto-replied',$reply->payload['headers']['Auto-Submitted']);
$this->assertSame('<[email protected]>',$reply->payload['headers']['In-Reply-To']);
$this->assertSame(file_get_contents(base_path('resources/mail/hn/logo.png')),base64_decode($reply->payload['attachments'][0]['content']));
$this->assertNull(app(AutoReplyService::class)->prepare($incoming,[]));
}
public function test_default_auto_reply_view_remains_legacy_for_other_instances(): void
{
$this->assertSame('mail.default.notify',config('mailflow.auto_reply_view'));
config(['mailflow.auto_reply_enabled'=>true]);
$incoming=MailMessage::create(['message_key'=>'default-incoming','direction'=>'in','purpose'=>'incoming','email'=>'[email protected]','subject'=>'Help','status'=>'received']);
$reply=app(AutoReplyService::class)->prepare($incoming,[]);
$this->assertStringContainsString('#142542',$reply->payload['html']);
$this->assertStringNotContainsString('Hard<span',$reply->payload['html']);
}
public function test_all_six_hn_templates_render_through_mail_service_preserving_business_subject(): void
{
Schema::create('v2_mail_templates',function(Blueprint $t){$t->id();$t->string('name');$t->string('subject');$t->text('content');$t->timestamps();});
Schema::create('v2_mail_log',function(Blueprint $t){$t->id();$t->string('email');$t->string('subject');$t->string('template_name');$t->text('error')->nullable();$t->integer('created_at')->nullable();$t->integer('updated_at')->nullable();});
config(['mailflow.logo_path'=>base_path('resources/mail/hn/logo.png')]);
$manifest=json_decode(file_get_contents(base_path('resources/mail/hn/manifest.json')),true);
$dispatcher=Mockery::mock(Dispatcher::class);
$dispatcher->shouldReceive('send')->times(6)->withArgs(function($params,$subject,$html){
$this->assertSame('Preserved purpose-specific subject',$subject);
$this->assertStringContainsString('Hard<span',$html);$this->assertStringContainsString('#B4F047',$html);
$this->assertDoesNotMatchRegularExpression('/\{\{[A-Za-z_]/',$html);
$this->assertStringNotContainsString('<script>',$html);$this->assertCount(1,$params['attachments']);return true;
})->andReturn(['status'=>'submitted','error'=>null]);$this->app->instance(Dispatcher::class,$dispatcher);
foreach($manifest['templates'] as $item){
\App\Models\MailTemplate::create(['name'=>$item['name'],'subject'=>'','content'=>file_get_contents(base_path('resources/mail/hn/'.$item['file']))]);
$out=\App\Services\MailService::sendEmail(['email'=>'[email protected]','subject'=>'Preserved purpose-specific subject','template_name'=>$item['name'],'purpose'=>'admin_test',
'template_value'=>['name'=>'HardNerd','url'=>'https://example.com','link'=>'https://example.com/login','code'=>'123456','content'=>'<script>not executable</script>','content_mode'=>'text']]);
$this->assertSame('submitted',$out['status']);$this->assertSame('db:'.$item['name'],$out['template_name']);
}
}
public function test_auto_reply_skips_automated_bulk_and_own_messages(): void
{
config(['mailflow.auto_reply_enabled' => true]);
@@ -134,6 +134,36 @@ class PaymentHealthTest extends TestCase
$q=new QrEvidence;$body='<p>32.00</p><div id="qr"></div><script>new QRCode(document.getElementById("qr"),"weixin://wxpay/bizpayurl?pr=fixture-only")</script>';
$this->assertTrue($q->valid($body,'wxpay',3200));$this->assertFalse($q->valid(str_replace('32.00','16.00',$body),'wxpay',3200));$this->assertFalse($q->valid('32.00 微信二维码','wxpay',3200));
}
public function test_cashier_requests_explicitly_accept_html_with_the_original_agent():void
{
Http::fake(['https://pay.airspay.top/*'=>Http::response('cashier',200)]);
$transport=new class extends HttpsTransport {protected function publicAddress(string $host):string{return '93.184.216.34';}};
$transport->request('POST','https://pay.airspay.top/submit.php',['money'=>'32.00']);
Http::assertSent(fn($r)=>$r->hasHeader('Accept','text/html')&&$r->hasHeader('User-Agent','XB-PaymentHealth/1.0')&&$r['money']==='32.00');
Http::assertSentCount(1);
}
public function test_wechat_https_qr_still_requires_exact_host_amount_and_rendering():void
{
$q=new QrEvidence;
$body='<p>32.00</p><script>$("#qrcode").qrcode({text:"https://wxmpurl.cn/fixture-only"});</script>';
$this->assertTrue($q->valid($body,'wxpay',3200));
$this->assertFalse($q->valid($body,'wxpay',1600));
$this->assertFalse($q->valid($body,'alipay',3200));
$this->assertFalse($q->valid('32.00 https://wxmpurl.cn/fixture-only','wxpay',3200));
foreach(['http://wxmpurl.cn/fixture','https://wxmpurl.cn.evil.invalid/fixture','https://sub.wxmpurl.cn/fixture',
'https://wxmpurlXcn/fixture','https://[email protected]/fixture','https://[email protected]/fixture',
'https://wxmpurl.cn:8443/fixture','https://evil.invalid/https://wxmpurl.cn/fixture',
'https://evil.invalid/?next=https://wxmpurl.cn/fixture','https://wxmpurl.cn/','https://wxmpurl.cn/fixture#fragment']as$url){
$this->assertFalse($q->valid(str_replace('https://wxmpurl.cn/fixture-only',$url,$body),'wxpay',3200),$url);
}
}
public function test_wechat_https_cashier_is_healthy_without_following_the_qr_url():void
{
$body='<p>32.00</p><script>$("#qrcode").qrcode({text:"https://wxmpurl.cn/fixture-only"});location.href="https://other.example.invalid/";</script>';
$t=new QueueTransport;$t->responses=[[200,$body]];
$out=(new TestEpayProbe($t,new QrEvidence))->probe(Payment::find(1),'fixture-trade');
$this->assertSame('healthy',$out['status']);$this->assertSame('fresh_cashier_qr',$out['reason']);$this->assertCount(1,$t->calls);
}
private function qrPng(int $pixels):string
{
$matrix=\BaconQrCode\Encoder\Encoder::encode('alipays://platformapi/startapp?appId=fixture-only',\BaconQrCode\Common\ErrorCorrectionLevel::M())->getMatrix();