staempfli/magento2-module-mailcatcher

此包已被弃用且不再维护。未建议替代包。

magento 2模块,用于在本地和开发环境中捕获、记录和重定向电子邮件

2.0.3 2019-04-11 11:12 UTC

This package is auto-updated.

Last update: 2020-09-16 12:10:45 UTC


README

Project Status: Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development. Codacy Badge Code Climate Issue Count

Magento 2模块,用于在本地和阶段环境中捕获、记录和重定向电子邮件。

功能

  • 捕获和记录所有电子邮件
  • 白名单域名或您不想捕获的电子邮件(商家域名、开发者电子邮件)
  • 将捕获的电子邮件重定向到trash-mail而不是记录它们

介绍

尽管捕获电子邮件的推荐方法是使用像MailHog这样的mailCatcher,但这并不总是容易在所有环境和配置中设置

事实

  • 并非所有开发人员都有相同的本地系统和配置
  • 阶段服务器可能使用不同的邮件传输代理(sendmail、postfix)
  • 项目可能使用商家SMTP服务器来发送电子邮件
  • 商家希望测试真实电子邮件的发送方式,而不使用捕获的Web UI

如果您遇到这些问题,这个模块就会很有用。此模块在电子邮件达到传输代理之前捕获电子邮件。无需为项目添加额外工具,只需在Magento管理员中安装并启用即可。

安装

$ composer require "staempfli/magento2-module-mailcatcher":"~1.0"

使用

Magento管理员 > 商店 > 配置 > Staempfli > 邮件捕获

Mail Catcher Admin Configuration

免责声明

此模块在Magento\Framework\Mail\TransportInterfaceFactory::create()上使用一个插件,请注意,您的代码或其他安装的模块不要覆盖该方法。

查看:etc/di.xml

测试

为了证明邮件捕获器始终有效,我们建议您在CI环境中运行包含的集成测试。将以下内容添加到您的dev/tests/integration/framework/phpunit.xml

<directory suffix="Test.php">&magentoDir;/vendor/staempfli/magento2-module-mailcatcher/Test/Integration</directory>

先决条件

  • PHP >= 7.0.*
  • Magento >= 2.1.*

开发者

Juan Alonso,以及其他所有贡献者

许可

开源软件许可("OSL") v. 3.0

版权

(c) 2017, Stämpfli AG