pixelart / swiftmailer-manipulator-bundle
修改 Swiftmailer 发送出去的邮件
1.1.0
2016-10-19 11:33 UTC
Requires
- php: ^5.4 || ^7.0
- symfony/framework-bundle: ^2.7 || ^3.0
- symfony/swiftmailer-bundle: ^2.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^1.12
- matthiasnoback/symfony-config-test: ^2.0
- phpunit/phpunit: ^4.8 || ^5.6
- symfony/phpunit-bridge: ^2.7 || ^3.0
This package is auto-updated.
Last update: 2024-09-14 21:55:27 UTC
README
有时候你有测试环境,你无法安装 MailHog,并且使用 SwiftmailerBundle 上的 delivery_address
或 disable_delivery
也不够。例如,你的客户希望邮件真正被发送。
但也许精心制作的邮件被发送给了合作伙伴、零售商、用户等,现在他们担心为什么收到了这些邮件(例如通知系统)。
这个包可以帮助你!它提供了 Swiftmailer 的插件,允许你在邮件发送之前修改每条消息的主题、正文或发件人地址。
安装
步骤 1:下载包
打开命令行,进入项目目录并执行以下命令以下载此包的最新稳定版本
$ composer require pixelart/swiftmailer-manipulator-bundle ^1.0
此命令需要你全局安装了 Composer,具体说明请参考 Composer 文档中的安装章节。
步骤 2:启用包
然后,将包添加到项目中 app/AppKernel.php
文件注册的包列表中,以启用该包
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Pixelart\Bundle\SwiftmailerManipulatorBundle\PixelartSwiftmailerManipulatorBundle(), ); // ... } // ... }
更多详细信息,请参阅配置页面。
完整的配置选项
# app/config/config.yml pixelart_swiftmailer_manipulator: mailers: first_mailer: prepend_subject: 'String prepend to subject' # String which is prepended onto the subject prepend_body: 'path/to/prepend_body.txt.twig' # Path to template which is prepended onto the mail body from_address: 'altered-form@example.com' # The address message should be sent from second_mailer: # ...
贡献
贡献指南这里包含了有关为包做出贡献的所有信息。
错误追踪
我们使用 GitHub 问题 和 waffle.io 画板 来跟踪问题。如果你发现了错误,请创建一个问题。
MIT 许可证
许可证可以在这里找到。
行为准则
本项目遵守贡献者协议行为准则。通过参与,你应遵守此准则。