aimtofeel/wp-swift-mailer
Composer 安装命令:
composer require aimtofeel/wp-swift-mailer
包简介
Implementation of Swift Mailer for Wordpress.
README 文档
README
Replaces default wp_mail(...) implementation with Swift Mailer support. Which will allow your website to send emails trough SMTP servers with ease.
Installation
This plugin can be installed with composer, not sure how to use Wordpress in combination with a package manager, take a look at Roots/Bedrock.
- Require the package:
composer require aimtofeel/wp-swift-mailer - Apply WP Swift Mailer configuration, and setup for example a SMTP connection
Configuration
To be able the start sending mail through Swift mailer we need to setup somethings. This package uses constants to setup the right values for you. The supported constants are listed below:
WP_SWIFT_MAILER_TRANSPORTER
Required
Possible values:
smtp
Currently this package only supports SMTP, just because I needed SMTP connectivity and don't really care about other transporters for now. But hey, if you want to help out and implement other Swift Mailer transporters feel free to submit a PR.
WP_SWIFT_MAILER_SENDER
Required
Define from which email address you would like to send mail from. For example: no-reply@example.com
WP_SWIFT_MAILER_SMTP_HOST
Required when using the SMTP transporter
Define your SMTP host. For example when using Gmail: smtp.gmail.com.
WP_SWIFT_MAILER_SMTP_PORT
Required when using the SMTP transporter
Define the port of the SMTP server. For example when using Gmail: 587.
WP_SWIFT_MAILER_SMTP_ENCRYPTION
Required when using the SMTP transporter
Encryption type of the SMTP connection. For example when using Gmail: tls.
WP_SWIFT_MAILER_SMTP_USERNAME
Not required, but probably needed when using SMTP transporter
The username of which you will be able to sign into the SMTP server. When using Gmail this is your email address.
WP_SWIFT_MAILER_SMTP_PASSWORD
Not required, but probably needed when using SMTP transporter
The password of which you will be able to sign into the SMTP server. When using Gmail this is your Gmail password.
Configuration example
Using Roots wp config:
Config::define('WP_SWIFT_MAILER_TRANSPORTER', 'smtp'); Config::define('WP_SWIFT_MAILER_SENDER', env('MAIL_SENDER')); Config::define('WP_SWIFT_MAILER_SMTP_HOST', env('SMTP_HOST')); Config::define('WP_SWIFT_MAILER_SMTP_PORT', env('SMTP_PORT')); Config::define('WP_SWIFT_MAILER_SMTP_ENCRYPTION', env('SMTP_ENCRYPTION')); Config::define('WP_SWIFT_MAILER_SMTP_USERNAME', env('SMTP_USERNAME')); Config::define('WP_SWIFT_MAILER_SMTP_PASSWORD', env('SMTP_PASSWORD'));
Using pure php:
define('WP_SWIFT_MAILER_TRANSPORTER', 'smtp'); define('WP_SWIFT_MAILER_SENDER', env('MAIL_SENDER')); define('WP_SWIFT_MAILER_SMTP_HOST', env('SMTP_HOST')); define('WP_SWIFT_MAILER_SMTP_PORT', env('SMTP_PORT')); define('WP_SWIFT_MAILER_SMTP_ENCRYPTION', env('SMTP_ENCRYPTION')); define('WP_SWIFT_MAILER_SMTP_USERNAME', env('SMTP_USERNAME')); define('WP_SWIFT_MAILER_SMTP_PASSWORD', env('SMTP_PASSWORD'));
Improvements list
- Add support for more Swift Mailer transporters
- Add support for mail attachments
Open to code submission
I'm always open to PR's. For example this package currently only supports the SMTP transporter, but it would be nice to support all Swift Mailer transporters. If you have some time on your hands and want to contribute, feel free to submit a PR.
Author
This package is created by AimToFeel.
License
aimtofeel/wp-swift-mailer 适用场景与选型建议
aimtofeel/wp-swift-mailer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 85 次下载、GitHub Stars 达 4, 最近一次更新时间为 2021 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「Swift Mailer」 「Wordpress mailer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aimtofeel/wp-swift-mailer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aimtofeel/wp-swift-mailer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aimtofeel/wp-swift-mailer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Parse a generic mail stream, and convert it to a SwiftMailer Message
PHP IBAN - This library provides a converter for account number, bank code and IBAN.
Creates new sare mail transport for laravel applications
Librairie pour interagir avec un object storage. Utilise l'api swift avec authentification v2 pour fonctionner avec OVH
Mandrill Api Integration for Yii2
Build and send emails.
统计信息
- 总下载量: 85
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2021-04-27