innocode-digital/wp-mail-helpers
Composer 安装命令:
composer require innocode-digital/wp-mail-helpers
包简介
Overrides mail From headers, adds check of mail functionality.
README 文档
README
Description
Overrides mail From headers, adds check of mail functionality.
Install
-
Preferable way is to use Composer:
composer require innocode-digital/wp-mail-helpersBy default it will be installed as Must Use Plugin. But it's possible to control with
extra.installer-pathsincomposer.json. -
Alternate way is to clone this repo to
wp-content/mu-plugins/orwp-content/plugins/:cd wp-content/plugins/ git clone git@github.com:innocode-digital/wp-mail-helpers.git cd wp-mail-helpers/ composer install
If plugin was installed as regular plugin then activate Mail Helpers from Plugins page
or WP-CLI: wp plugin activate wp-mail-helpers.
Usage
Constants
If it's needed to override From mail headers in all emails then next constant should be
added (usually to wp-config.php):
define( 'MAIL_FROM_ADDRESS', '' );
define( 'MAIL_FROM_NAME', '' );
Notes
It's not required to set both constants, in most cases you only need to set MAIL_FROM_ADDRESS.
Plugin sets hook with pretty big priority 9999 but another plugins and themes could set
bigger value and in this case you should change priority according to your needs, e.g.:
if ( function_exists( 'innocode_mail_helpers' ) ) {
remove_filter( 'wp_mail_from', [ innocode_mail_helpers(), 'mail_from' ], 9999 );
add_filter( 'wp_mail_from', [ innocode_mail_helpers(), 'mail_from' ], 10001 );
}
Settings
There is a possibility to set From mail headers in WordPress administration panel: Settings > Mail. From Email should be verified in a similar way like WordPress verifies Administration Email Address. These settings have bigger priority than constants.
Tools
Plugin adds a tool for testing mail functionality. You can send a test email in WordPress administration panel from Tools > Mail page.
innocode-digital/wp-mail-helpers 适用场景与选型建议
innocode-digital/wp-mail-helpers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.32k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 03 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 innocode-digital/wp-mail-helpers 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 innocode-digital/wp-mail-helpers 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 14.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 14
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2020-03-26