freento / emailslog
Catches all emails sent from a Magento store and additionally logs them to the database.
Emails Log extension for Magento 2
The Emails Log extension for Magento 2 / Adobe Commerce is a powerful debugging tool that allows you to analyze sent emails. Administrators and owners of online stores can use it to see the sending status, content of emails and other necessary and important information.
The report appears in a separate grid and contains the following data for all the emails sent from your Magento 2 store:
- recipient
- Bcc
- subject of the email
- status of the email: Success, Failed or Not Sent
- template the email was built from
- store view the email was sent for
- created at
- action - a link to the detailed view of the email
You can also export the report for further analysis.
Key features include:
- Comprehensive report
- Clickable column actions
- Built-in export to CSV or Excel XML
- Option to clear records older than (N days)
- Optional logging of emails that the store is configured not to send
- Email content rendered in an isolated frame, so it cannot affect the Admin panel
- Access to the log protected by its own permission resource
All columns of the report can be sorted, and almost all can be filtered. Moreover, the report can be exported for further import and analysis. You can export the report to CSV or Excel XML. You can also set up an automatic cleanup of log entries after the number of days you specify.
Refer to the extension page for the full description and user guide: https://commercemarketplace.adobe.com/freento-emailslog.html
Logging while email communications are disabled
When Stores > Configuration > Advanced > System > Mail Sending Settings > Disable Email Communications is set to Yes, Magento sends no emails at all. Set Log emails even if email communications is disabled to Yes in the extension configuration, and such emails are still written to the log with the Not Sent status, although they are not delivered. This is useful on staging and QA environments, where outgoing mail must stay off, but you need to see which emails the store would have sent.
Sales emails (order, invoice, shipment, credit memo and their comment emails) are an exception: Magento skips them before they are composed, so they are not logged in this mode. The setting never affects email delivery itself, it only controls what is written to the log.
Requirements
- PHP 8.1 or later
- Freento_Base, installed automatically as a Composer dependency
Installation
You can install the Emails Log extension with Composer:
composer require freento/emailslog
Then run:
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
Configuration and permissions
The extension settings are located in Stores > Configuration > Freento > Emails Log, and the grid itself in Freento > Emails Log in the Admin menu.
Access to the log is controlled by the Freento > Emails Log resource. Grant it in System > Permissions > User Roles to every role that needs access to the log, otherwise the grid and the view page are not available to that role.
Release Notes
1.4.0
This release adds logging of emails that Magento does not send, closes a security issue on
the email view page, makes logging unable to break email delivery, and moves the module under
the shared Freento admin menu.
Requirements
- Freento_Base is now required. It is declared as a Composer dependency (
freento/base) and
inetc/module.xml, so Composer installs it automatically together with this module — no manual
installation needed. The module relies on Freento_Base for the top level "Freento" admin menu
item, theFreento_Base::freento_baseACL resource and the "freento" configuration tab.
New features
-
New setting: "Log emails even if email communications is disabled"
(Stores > Configuration > Freento > Emails Log,emailslog/general/log_when_emails_disabled,
default "No"). It only applies when the core settingStores > Configuration > Advanced > System > Mail Sending Settings > Disable Email Communicationsis set to "Yes":- Yes — emails are still written to the log, with the new "Not Sent" status, although they
are not delivered. Useful on staging and QA environments where outgoing mail must stay off,
but you still need to see which emails the store would have sent. - No — nothing is logged while email communications are disabled (the 1.3.2 behaviour).
When "Disable Email Communications" is "No", the setting has no effect: emails are sent and
logged as usual. The setting never affects email delivery itself, it only controls the log.Known limitation: sales emails (order, invoice, shipment, credit memo and their comment
emails) are not logged even when the setting is "Yes". While email communications are disabled,
Magento skips these emails before they are composed, so the module has nothing to intercept. - Yes — emails are still written to the log, with the new "Not Sent" status, although they
-
New "Not Sent" log status for emails that were logged but not delivered because email
communications are disabled. It is available as a filter in the Emails Log grid. -
Emails sent from the Admin panel now show their store. Store id
0(Admin) is stored and
rendered as "Admin" instead of "-", both in the grid and on the view page. This affects new
records only; existing records keep an empty store.
Security
-
The email body is now always rendered in an isolated iframe. The email HTML is no longer
inserted directly into the Admin page, so it can neither run scripts with the permissions of the
current admin user, nor override the styles of the Admin panel. -
The iframe response is hardened.
Controller\Adminhtml\Log\Iframenow sends
Content-Security-Policy: sandbox allow-same-origin allow-popups allow-popups-to-escape-sandbox,
X-Content-Type-Options: nosniffand an explicitContent-Type. The same flags are applied to
thesandboxattribute of the iframe. Scripts and forms inside the email are blocked, also when
the iframe URL is opened directly. -
All Admin controllers now declare an ACL resource.
Index,View,IframeandMassDelete
useADMIN_RESOURCE = 'Freento_EmailsLog::freento_log'. Previously they fell back to the default
Magento_Backend::admin, so email logs, including password reset links, were available to any
admin user. The menu item now points to this existing resource as well, instead of an ACL
resource that was never declared.Action required: grant the "Freento > Emails Log" resource to the roles that need access.
Fixes
- A logging failure can no longer break email delivery. Writing the log was moved out of the
finallyblock into a dedicated method that never throws: any failure (for example a database
error) is written toexception.loginstead. Sending errors are caught asThrowable, so an
email that fails with a PHP error is now logged as "Failed" too, and the original exception is
passed through unchanged. - Emails with no "To" address and emails with no subject no longer cause a fatal error.
- All "To" recipients are logged, comma separated, instead of the first one only.
- The view page no longer fails for emails without a store, for example the Admin
"Forgot Password" email. - Fixed the layout of the view page. The columns use flex instead of floats, and long
unbreakable strings (such as password reset links) no longer push the content column below the
information column. - Fixed an invalid DI preference.
- API and constructor signatures changed in the repository interfaces,
Helper\Config, the
view block and the transport plugin. Third party code extending these classes may need updates.
Removed
- The "Display content in a frame" setting (
emailslog/general/show_iframe) was removed, as
the email body is now always shown in an iframe. A leftoveremailslog/general/show_iframerow
may remain incore_config_data; it is no longer used. - The module no longer declares the "freento" configuration tab — it is declared by
Freento_Base now. - The module no longer creates its own root admin menu item under System. "Emails Log" moved
under the "Freento" menu item provided by Freento_Base.
Upgrade notes
- Update the module with Composer. Freento_Base is pulled in as a dependency, so no separate
installation step is needed. - Grant the "Freento > Emails Log" ACL resource to the roles that need access to the log.
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 1.4.1 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-11-10 17:02:58 |
| 1.4.0 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-11-09 13:23:03 |
| 1.3.2 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2025-08-21 09:43:11 |
| 1.3.1 | stable | Not tested | Not yet tested Details | 2025-03-18 10:31:20 |
| 1.2.0 | stable | Not tested | Not yet tested Details | 2024-03-17 19:14:20 |
Requires 2
| Package | Constraint |
|---|---|
| freento/base | ^1.0 |
| php | >=8.1 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from Freento
View vendorMCP Audit Tools for Magento 2
MCP (Model Context Protocol) server for Magento 2 - All-in-one module
Dimensional Shipping module with REST API integration
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.