https://github.com/staempfli/magento2-module-mailcatcher
Magento 2 Module to catch, log and redirect emails on Local and Dev Servers
https://github.com/staempfli/magento2-module-mailcatcher
magento2 magento2-extension
Last synced: 7 months ago
JSON representation
Magento 2 Module to catch, log and redirect emails on Local and Dev Servers
- Host: GitHub
- URL: https://github.com/staempfli/magento2-module-mailcatcher
- Owner: staempfli
- Created: 2017-09-26T08:59:53.000Z (almost 9 years ago)
- Default Branch: develop
- Last Pushed: 2022-05-05T17:06:19.000Z (over 4 years ago)
- Last Synced: 2025-07-17T18:11:18.302Z (about 1 year ago)
- Topics: magento2, magento2-extension
- Language: PHP
- Size: 162 KB
- Stars: 14
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Magento 2 Mail Catcher
[](http://www.repostatus.org/#abandoned)
[](https://www.codacy.com/app/Staempfli/magento2-module-mailcatcher?utm_source=github.com&utm_medium=referral&utm_content=staempfli/magento2-module-mailcatcher&utm_campaign=Badge_Grade)
[](https://codeclimate.com/github/staempfli/magento2-module-mailcatcher)
[](https://codeclimate.com/github/staempfli/magento2-module-mailcatcher)
Magento 2 module to catch, log and redirect emails on local and stage enviroments.
Features:
* Catch and log all emails
* Whitelist domains or emails that you do not want to catch (Merchant domain, developer emails)
* Redirect catched emails to a [trash-mail](https://www.trash-mail.com/inbox/) instead of logging them
## Introduction
Although the recommended way to catch emails is using a mailCatcher like [MailHog](https://github.com/mailhog/MailHog), this is not always easy to setup in all environments and configurations:
Facts:
* Not all your developers have same local systems and configurations
* Stage servers might use different mail transfer agents (sendmail, postfix)
* Projects might use the merchant STMP server for sending emails
* Merchants want to test how real emails are sent and not use a catching Web UI
If you have these problems, that's when this module comes in handy. This module catches emails before they reach the transfer agent. No extra tools needed for your projects, simply install and enable it on Magento Admin.
## Installation
```
$ composer require "staempfli/magento2-module-mailcatcher":"~1.0"
```
## Usage
`Magento Admin > Stores > Configuration > Staempfli > Mail Catcher`

## Disclaimer
This module uses a plugin on `Magento\Framework\Mail\TransportInterfaceFactory::create()`, watch out that your code or other modules installed do not overrite that method.
See: [etc/di.xml](etc/di.xml)
## Tests
In order to prove that the mail catcher always work, we recommend you to run included integration tests on your CI environment. Add this into your `dev/tests/integration/framework/phpunit.xml`:
```
&magentoDir;/vendor/staempfli/magento2-module-mailcatcher/Test/Integration
```
## Prerequisites
- PHP >= 7.0.*
- Magento >= 2.1.*
## Developers
Juan Alonso, and all other [contributors](https://github.com/staempfli/magento2-module-mailcatcher/contributors)
## License
[Open Software License ("OSL") v. 3.0](https://opensource.org/licenses/OSL-3.0)
## Copyright
(c) 2017, Stämpfli AG