评论通知邮件无样式:接管核心通知正文 #39
卸载 wpDiscuz 后,评论通知回落到核心 wp_notify_postauthor / wp_notify_moderator。theme-mail.php 只接管了通道(SMTP、From), 并把 Content-Type 强改成 text/html,而正文仍是核心拼的纯文本, 客户端按 HTML 渲染 ⇒ 换行丢、链接变裸地址。 新增 inc/theme-mail-core.php,挂 comment_notification_text / comment_moderation_text 两个过滤器,把正文换成主题模板。这是核心 自己提供的扩展点,不改核心文件,删掉即回退。 模板新增 links 参数,把 通过/回收站/垃圾 渲染成一行文字链接 (并排三按钮在手机上必然换行、高度不齐)。 版本 4.2.1 -> 4.2.2
This commit is contained in:
@@ -95,6 +95,11 @@ require get_template_directory() . '/inc/theme-mail-template.php';
|
||||
// 邮件治理:统一接管发信通道、去重、关掉重复通知
|
||||
require get_template_directory() . '/inc/theme-mail.php';
|
||||
|
||||
// 核心评论通知正文接管:挂 comment_notification_text / comment_moderation_text
|
||||
// 两个过滤器。不接管的话,核心那封纯文本会被 Content-Type: text/html 硬渲染,
|
||||
// 收件人看到的是一堆没有样式的裸地址(3.2.18 卸载 wpDiscuz 后才暴露)。
|
||||
require get_template_directory() . '/inc/theme-mail-core.php';
|
||||
|
||||
// SMTP 配置(连通性相关,实际接管在 theme-mail.php)
|
||||
require get_template_directory() . '/inc/theme-smtp.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user