Magento 2 Extension
EmailTester 2
Preview any transactional email in your Magento 2 backend
Preview any transactional email in your Magento 2 backend
Go to your Magento 2 backend, open up the EmailTester page and you are set. You can quickly select any transactional email and preview the email in your browser or send it to a specific inbox.
Most transactional emails in Magento require some kind of data: Customer details, product pricing, a valid quote. EmailTester makes it extremely use to pick a mail and fill it with the dummy data that you want to test.
With EmailTester, you can select a Magento transactional email and preview it in the browser or send it to an emailaddress of your choice. The preview window allows you to refresh the page, while you work on improving the email layout in your editor.
Sending the email allows you to easily double-check whether the mail is displayed properly across multiple email clients.
From within the form where you select the email to work with, you can also select a customer, a product and an order. From these data, EmailTester is able to derive all email variables needed to display an email with actual content. Inserting different customers or products is easily done. You never need to create a complete test-order again in the frontend to test email behavior.
Our EmailTester picks up on any email that is built using the Magento transactional email system. Simply put, if you can override it in the Magento backend, you can test it with EmailTester.
Additionally, you create your own module to insert additional data into the EmailTester system, for instance if a third party extension adds a new entity to emails. We've made this really easy for developers to adopt: Just use the core event email_order_set_template_vars_before
which is meant for this thing.
We recommend to install Magento 2 extensions via composer. See the Composer project for instructions on how to get composer up and running. Once composer is installed, use the following command to install our extension.
composer require yireo/magento2-emailtester2
This will make composer download the package from Packagist. After the composer installation has finished, use the following commands to enable the module within Magento:
bin/magento module:enable Yireo_EmailTester2
bin/magento cache:clean
bin/magento setup:upgrade
After these commands, the extension is ready for use in Magento. If you were already logged into the Magento Admin Panel, make sure to logout and log back in again, before proceeding. Do not forget to grab yourself a manual copy of our extension as a backup.
Please note that we strongly recommend using composer instead. If you bump into issues with this manual procedure, the first thing we need to ask is whether you have installed all dependencies, as mentioned in the composer.json
file of this extension. If the composer.json file of this extension mentions requirements, you need to fulfill these requirements. This could involve checking for PHP requirements but also installing third party add-ons. Sounds difficult? Yes! That's why we can only recommend you to use composer. The manual installation does NOT make your life easier, even if you think it does.
Do use composer: It allows for dependency tracking and in the end, prevents breaking your site. However, in some cases, it might be required to do a non-composer installation. For these exceptional situations, download the module ZIP from our site (under the tab File Downloads). Next, create a folder with the following name and copy to the ZIP contents to it:
app/code/Yireo/EmailTester2
After the files have been uploaded, confirm that all files are in place. For instance, you should have a file like app/code/Yireo/EmailTester2/etc/module.xml
. Next, use the following commands to enable the module within Magento:
bin/magento module:enable Yireo_EmailTester2
bin/magento cache:clean
bin/magento setup:upgrade
After these commands, the extension is ready for use in Magento. If you were already logged into the Magento Admin Panel, make sure to logout and log back in again, before proceeding. Do not forget to grab yourself a manual copy of our extension as a backup.
Head over to the GitHub repository for downloads: https://github.com/yireo/Yireo_EmailTester2
As of yet, Hyvä does not alter the way that email templates are styled. So yes, the EmailTester extension works together with Hyvä.
No, it is not. As a policy, all our Yireo software is unencrypted - we do not make use of technologies like ionCube or ZendOptimizer. All PHP-code is open source, but for commercial extensions the code is only given to paying customers.
You probably would like to know if this extension is working under a specific Magento version 2.X.Y. However, from a technical point of view, the question is wrong: The major Magento version 2.X.Y is not semantical but instead used for marketing purposes. It doesn't give any guarantees.
Instead, we maintain compatibility with the actual modules that lie underneath (like Magento_Catalog
or the Magento Framework). And version management for these dependencies is handled via composer
. We strongly advice you to rely on composer
to answer the question whether our extension works under a specific Magento version. This is the only way to guarantee compatibility in a professional way.
Alternatively, study our CHANGELOG
for details on the progress we made.
This extension is offered for free. Feel free to go the GitHub repository (see the link under Quick Start> Downloads) and open an Issue there. Please note that this is a voluntary open source project. The more helpful you are in describing the issue at hand, the more likely volunteers can come in to help you with the issue.
Our extension is developed to incorporate newer PHP features like type hinting, spaceship operators and terniary operators. For this, we recommend that PHP is running at least version PHP 7.1, but we recommend PHP 7.2. The actual requirements are always documented in our composer.json
file.
It might be that the very fact that our composer.json
file is mentioning a certain PHP requirement is conflicting with another Magento package that has defined a wrong dependency. If you are sure our extension meets the PHP requirements, you can skip this check using the --ignore-platform-reqs
flag of composer:
composer require yireo/magento2-emailtester2 --ignore-platform-reqs
If you encounter an issue where an email override in your Magento Admin Panel doesn't parse the products output, while the original email does, note that this is not an issue with our extension but with newer versions of Magento. Specifically, since Magento 2.3.4, the following instruction is no longer allowed (specifically, the usage of an $order
object in email templates stored in the database):
{{layout handle="sales_email_order_items" order=$order}}
Either you can migrate your email templates towards newer code that works (where EmailTester will simply support those new variables), or mark your template as legacy. Open up the database table email_template
, locate the template_id
of the email template in question and set the flag is_legacy
to 1
.
Yes, it does. The MagePlaza SMTP extension hooks into the Magento TransportBuilder
and because of this, they simply work together. Actually, this is leading to one of our recommended test-setups: Install the MagePlaza SMTP extension (or some other similar extension), configure it to use the SMTP details of a testing email provider like mailtrap.io. Next, send the email via EmailTester and it should simply popup in the inbox of mailtrap.
If you run into problems, we are happy to help you out with the following resources:
We usually respond in 24 hours but understand this is all done on a voluntary basis. Also note that we require you to collaborate together with us. Interpret errors as best as you can, before claiming our time. Free software does not automatically lead into free support as well.
EmailTester is written following standards like PSR-2, MEQP2, ECG and ExtDN.
You can hook into the core event email_order_set_template_vars_before
or the custom event emailtester_variables
. The second event allows you to inject more dummy content into your test emails.
We have shipped some Integration Tests with this extension, one of which is trying to preview any transactional email found by the extension. This might be slow. We don't care.
Also, this should allow you to determine whether EmailTester works together with transactional emails supplied by a third party extension. Let us know your feedback if you bump into issues here.
This extension ships with PHPUnit tests. The generic PHPUnit configuration in Magento 2 will pick up on these tests. To only test Yireo extensions, you can also run the following:
./vendor/bin/phpunit -c ./vendor/yireo/magento2-emailtester2/phpunit.xml.yireo
See the Magento document for the full procedure.
2.2
(2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9, 2.2.10
) 2.3
(2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.5-p1, 2.3.5-p2, 2.3.6, 2.3.7, 2.3.7-p1, 2.3.7-p2
) 2.4
(2.4.0, 2.4.1, 2.4.2, 2.4.2-p1, 2.4.2-p2, 2.4.3, 2.4.4, 2.4.5
) magento/framework
: ^101.0.1|^101.1|^102.0|^103.0
magento/module-backend
: ^100.0|^101.0|^102.0
magento/module-catalog
: ^101.0|^102.0|^103.0|^104.0
magento/module-checkout
: ^100.0
magento/module-config
: ^100.0|^101.0
magento/module-customer
: ^100.0|^101.0|^102.0|^103.0
magento/module-eav
: ^100.0|^101.0|^102.0
magento/module-email
: ^100.0|^101.0
magento/module-payment
: ^100.0
magento/module-quote
: ^100.0|^101.0
magento/module-sales
: ^100.0|^101.0|^102.0|^103.0
magento/module-store
: ^100.0|^101.0
magento/module-ui
: ^101.0
ext-pcre
: *
ext-json
: *
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
preg_replace
error in Magento coreshipping_id
invoice_id
and creditmemo_id
just in caseorder_id
setup_version
for Magento 2.2 compatibilitypreview
) to avoid conflicts with other mixinssetup_version
because there is no setupreact_loader.html
Knockout HTMLbin/magento yireo_emailtester2:list
)bin/magento yireo_emailtester2:send
)etc/config.xml
checkout_payment_failed_template
emailemail_order_set_template_vars_before
and emailtester_variables
ExtDN forms a network of Magento extension developers, that strive for a better extension quality - both on a technical level and from an end-users point of view. With industry leaders like Fooman and aHeadworks, ExtDN lifts up the Magento extension space to a new level. And Yireo is proud to be part of this.
We don't write too commercial stuff, we focus on the technology (which we love) and we regularly come up with innovative solutions. Via our newsletter, you can keep yourself up to date on all of this coolness. Subscribing only takes seconds.
Sign up for the Yireo newsletter