freento / emailslog

freento/emailslog

Catches all emails sent from a Magento store and additionally logs them to the database.

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass MIT

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.1

Fixes

  • The email view page no longer fails with a dependency injection error. The constructor of
    Controller\Adminhtml\Log\View declared an untyped required $resultFactory argument that the
    ObjectManager could not resolve, so in developer and default mode the page failed with
    BadMethodCallException: Missing required argument $resultFactory. The argument was removed —
    $this->resultFactory is provided by the parent controller. In production mode the compiled DI
    configuration passed null for this argument and the parent constructor overwrote it right
    after, so the page worked there and the problem stayed invisible.

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
    in etc/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, the Freento_Base::freento_base ACL 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 setting Stores > Configuration > Advanced > System > Mail Sending Settings > Disable Email Communications is 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.

  • 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\Iframe now sends
    Content-Security-Policy: sandbox allow-same-origin allow-popups allow-popups-to-escape-sandbox,
    X-Content-Type-Options: nosniff and an explicit Content-Type. The same flags are applied to
    the sandbox attribute 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, Iframe and MassDelete
    use ADMIN_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
    finally block into a dedicated method that never throws: any failure (for example a database
    error) is written to exception.log instead. Sending errors are caught as Throwable, 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 leftover emailslog/general/show_iframe row
    may remain in core_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

  1. Update the module with Composer. Freento_Base is pulled in as a dependency, so no separate
    installation step is needed.
  2. Grant the "Freento > Emails Log" ACL resource to the roles that need access to the log.
Versions
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.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

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.

Static analysis results
Tool Status Findings Summary
PHPCS Pass 0
PHPMD Pass 0
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 5 5
2.4.8 5 5
2.4.9 5 5

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

Unit tests results by Magento and PHP version
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

Integration tests results by Magento and PHP version
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.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
MIT

More from Freento

View vendor
Make it pay

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.