PHPackages                             hryvinskyi/magento2-asynchronous-email-sending - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. hryvinskyi/magento2-asynchronous-email-sending

ActiveMagento2-module[Mail &amp; Notifications](/categories/mail)

hryvinskyi/magento2-asynchronous-email-sending
==============================================

Asynchronous Email Sending module for Magento 2 - Queues emails for background processing via cron to improve performance

1.1.0(3mo ago)5152MITPHPPHP ~8.3.0|~8.4.0

Since Sep 6Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/hryvinskyi/magento2-asynchronous-email-sending)[ Packagist](https://packagist.org/packages/hryvinskyi/magento2-asynchronous-email-sending)[ RSS](/packages/hryvinskyi-magento2-asynchronous-email-sending/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Magento 2 / Adobe Commerce Asynchronous Email Sending
=====================================================

[](#magento-2--adobe-commerce-asynchronous-email-sending)

A Magento 2 module that queues all outgoing emails for asynchronous processing via cron jobs, significantly improving store performance by offloading email sending to background processes.

Features
--------

[](#features)

- **Performance Optimization**: Queues all outgoing emails instead of sending them synchronously
- **Admin Grid Interface**: Full-featured admin panel for managing email queue
- **Cron-based Processing**: Sends emails in batches via configurable cron jobs
- **Configurable Limits**: Control how many emails are sent per cron execution
- **Queue Management**: Automatic cleanup of successfully sent and failed emails
- **Mass Actions**: Delete or resend multiple emails at once from admin
- **Email Preview**: View email content directly in admin panel via iframe
- **Debug Mode**: Detailed logging for troubleshooting email issues
- **Symfony Mailer Support**: Fully compatible with Magento 2.4.8+ and Symfony Mailer

Requirements
------------

[](#requirements)

- **Magento**: 2.4.8 or higher
- **PHP**: 8.3 or 8.4
- **Composer**: Latest version

Installation
------------

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require hryvinskyi/magento2-asynchronous-email-sending
bin/magento module:enable Hryvinskyi_AsynchronousEmailSending
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

### Manual Installation

[](#manual-installation)

1. Create the directory structure: `app/code/Hryvinskyi/AsynchronousEmailSending`
2. Copy all module files to the directory
3. Run the following commands:

```
bin/magento module:enable Hryvinskyi_AsynchronousEmailSending
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

Configuration
-------------

[](#configuration)

Navigate to: **Stores &gt; Configuration &gt; System &gt; Hryvinskyi Asynchronous Email Sending**

### General Settings

[](#general-settings)

SettingDescriptionDefault**Enable**Enable/disable asynchronous email sendingNo**Sending Limit**Maximum number of emails to send per cron execution10**Clear Success After (Days)**Days to keep successfully sent emails before cleanup7**Clear Errors After (Days)**Days to keep failed emails before cleanup30**Debug Mode**Enable detailed logging to `var/log/hryvinskyi_asynchronous_email_sending.log`NoAdmin Grid Interface
--------------------

[](#admin-grid-interface)

Navigate to: **System &gt; Async Email Queue**

The admin grid provides a comprehensive interface for managing queued emails:

### Grid Columns

[](#grid-columns)

ColumnDescription**ID**Unique email identifier**Status**Email status with colored badges (Pending, Sent, Error)**Subject**Email subject line**Created At**When the email was queued**Sent At**When the email was sent (if applicable)**Actions**View, Resend, Delete### Available Actions

[](#available-actions)

#### Mass Actions

[](#mass-actions)

- **Delete**: Remove selected emails from the queue
- **Resend**: Reset selected emails to pending status for reprocessing

#### Row Actions

[](#row-actions)

- **View**: Display email details including headers and content preview
- **Resend**: Queue individual email for resending
- **Delete**: Remove individual email from queue

### Email View Page

[](#email-view-page)

The view page displays:

- Email metadata (ID, status, timestamps)
- Parsed email headers (From, To, Subject, etc.)
- Email content preview in an iframe
- Action buttons: Back to List, Resend, Delete

### ACL Permissions

[](#acl-permissions)

ResourceDescription`Hryvinskyi_AsynchronousEmailSending::email_queue`Access to email queue menu`Hryvinskyi_AsynchronousEmailSending::email_queue_view`View email queue and details`Hryvinskyi_AsynchronousEmailSending::email_queue_delete`Delete emails from queue`Hryvinskyi_AsynchronousEmailSending::email_queue_resend`Resend emailsHow It Works
------------

[](#how-it-works)

### 1. Email Capture

[](#1-email-capture)

When your Magento store attempts to send an email:

- The module intercepts the `TransportInterface::sendMessage()` call via a plugin
- Extracts the raw email message (headers + body)
- Stores it in the `hryvinskyi_asynchronous_email_sending` database table with status = `0` (pending)

### 2. Queue Processing

[](#2-queue-processing)

The cron job `hryvinskyi_asynchronous_sending_send_emails` runs periodically:

- Fetches up to N pending emails (configured via "Sending Limit")
- Parses the raw message to extract headers and body
- Reconstructs the email using Magento's mail framework
- Sends the email via configured SMTP settings
- Updates status to `1` (success) or `2` (failed)

Logging
-------

[](#logging)

When debug mode is enabled, the module logs to:

```
var/log/hryvinskyi_asynchronous_email_sending.log

```

Log entries include:

- Queued email details
- Sending attempts and results
- Parsing errors
- SMTP/transport errors

Troubleshooting
---------------

[](#troubleshooting)

### Emails Not Being Sent

[](#emails-not-being-sent)

1. **Verify cron is running**:

    ```
    bin/magento cron:run
    ```
2. **Check queue status**:

    ```
    SELECT status, COUNT(*) FROM hryvinskyi_asynchronous_email_sending GROUP BY status;
    ```

    Status: 0 = Pending, 1 = Sent, 2 = Failed
3. **Enable debug mode** and check logs at `var/log/hryvinskyi_asynchronous_email_sending.log`
4. **Verify SMTP configuration** in Magento admin

### Failed Emails (Status = 2)

[](#failed-emails-status--2)

Check the log file for specific error messages. Common issues:

- Invalid SMTP credentials
- Network connectivity problems
- Malformed email addresses
- Missing required headers

### Manual Queue Processing

[](#manual-queue-processing)

You can manually trigger email sending using the CLI command:

```
bin/magento hryvinskyi:email:send
```

Or via cron:

```
bin/magento cron:run --group=default
```

Compatibility
-------------

[](#compatibility)

Magento VersionModule VersionPHP VersionStatus2.4.8+1.1.0+8.3, 8.4Fully Supported2.4.6 - 2.4.71.0.x8.1, 8.2Use older version&lt; 2.4.6Not supported-Not compatibleChangelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history and updates.

License
-------

[](#license)

This module is licensed under the MIT License. See [LICENSE](LICENSE) for details.

Author
------

[](#author)

**Volodymyr Hryvinskyi**

- Email:
- GitHub: [@hryvinskyi](https://github.com/hryvinskyi)

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance81

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~657 days

Total

4

Last Release

101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e254b6c28f67e639b2beb3f21a80f2b4ff9efc5ee782943d497b73523f630c1d?d=identicon)[hryvinskyi](/maintainers/hryvinskyi)

---

Top Contributors

[![hryvinskyi](https://avatars.githubusercontent.com/u/9294098?v=4)](https://github.com/hryvinskyi "hryvinskyi (7 commits)")

### Embed Badge

![Health badge](/badges/hryvinskyi-magento2-asynchronous-email-sending/health.svg)

```
[![Health](https://phpackages.com/badges/hryvinskyi-magento2-asynchronous-email-sending/health.svg)](https://phpackages.com/packages/hryvinskyi-magento2-asynchronous-email-sending)
```

###  Alternatives

[magepal/magento2-gmailsmtpapp

Magento 2 SMTP Extension - Configure Magento 2 to send all transactional email using Gmail, G Suite, Amazon SES, Office360, Mailgun, SendGrid, Mandrill or any other SMTP servers

3321.8M2](/packages/magepal-magento2-gmailsmtpapp)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[yireo/magento2-emailtester2

Preview transactional emails and test send them in your backend

33394.9k](/packages/yireo-magento2-emailtester2)[fredden/magento2-module-javascript-error-reporting

A Magento 2 module which captures JavaScript errors for later review by website administrators

3138.1k](/packages/fredden-magento2-module-javascript-error-reporting)[swissup/module-email

Magento2 email providers integration (smtp, mandrill, amazon ses)

1412.8k1](/packages/swissup-module-email)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

126.8k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
