PHPackages                             kgrruz/codeigniter4-email-queue - 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. kgrruz/codeigniter4-email-queue

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

kgrruz/codeigniter4-email-queue
===============================

Queue, preview and and send emails stored in the database

v1.0.2(3y ago)101311MITPHPPHP ^7.4 || ^8.0

Since Oct 7Pushed 2y ago2 watchersCompare

[ Source](https://github.com/kgrruz/codeigniter4-email-queue)[ Packagist](https://packagist.org/packages/kgrruz/codeigniter4-email-queue)[ Docs](https://github.com/kgrruz/codeigniter4-email-queue)[ RSS](/packages/kgrruz-codeigniter4-email-queue/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Codeigniter4 email queue
========================

[](#codeigniter4-email-queue)

Queue, preview and and send emails stored in the database.

This package provides an interface for creating emails on the fly and store them in a queue to be processed later by an offline worker using a Codeigniter4 CLI command.

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

[](#requirements)

- Codeigniter 4.x
- codeigniter4/settings

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

[](#installation)

```
composer require kgrruz/codeigniter4-email-queue
```

### run migrations command:

[](#run-migrations-command)

```
php spark migrate -n EmailQueue
```

Usage
-----

[](#usage)

You must set these configuration in the **app/Config/Email.php** or set these values using the [codeigniter4/settings](https://github.com/codeigniter4/settings) package before using it:

```
    setting('Email.fromEmail')
    setting('Email.fromName')
    setting('Email.protocol')
```

In case of SMTP protocol:

```
    setting('Email.SMTPHost')
    setting('Email.SMTPPort')
    setting('Email.SMTPUser')
    setting('Email.SMTPPass')
    setting('Email.SMTPCrypto')
    setting('Email.SMTPTimeout')
    setting('Email.SMTPKeepAlive')
```

Default email settings:

```
    $config['mailpath'] = '/usr/sbin/sendmail';
    $config['wordWrap'] = true;
    $config['mailType'] = 'html';
```

Whenever you need to send an email, use the EmailQueue model to create and queue a new one by storing the correct data:

```
use EmailQueue\EmailQueue;
EmailQueue::enqueue($to, $subject, $attachments, $data);

```

`enqueue` method receives 3 arguments:

- First argument is a string of email addresses that will be treated as recipients.
- Second argument is an string with the email subject
- Third argument is an array of files paths
- Fourth argument is an array of view variables to be passed to the email template

- `message`: Email's body text/html

    $data\['message'\] = "hello world message";

### Sending emails

[](#sending-emails)

Emails should be sent using bundled Sender command, use `-l` option to limit the number of emails processed

```
# php spark emails:send -l 10

```

You can configure this command to be run under a cron or any other tool you wish to use.

Todo
====

[](#todo)

- Priority
- BCC,CC

Contributing
============

[](#contributing)

Run the tests
-------------

[](#run-the-tests)

```
./vendor/bin/phpunit tests/

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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 ~134 days

Total

3

Last Release

1416d ago

PHP version history (2 changes)1.0.0PHP ^7.3 || ^8.0

v1.0.2PHP ^7.4 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![kgrruz](https://avatars.githubusercontent.com/u/17552267?v=4)](https://github.com/kgrruz "kgrruz (15 commits)")

---

Tags

emailcodeigniterqueuecroncodeigniter4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kgrruz-codeigniter4-email-queue/health.svg)

```
[![Health](https://phpackages.com/badges/kgrruz-codeigniter4-email-queue/health.svg)](https://phpackages.com/packages/kgrruz-codeigniter4-email-queue)
```

###  Alternatives

[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57121.5k1](/packages/lorenzo-cakephp-email-queue)[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

87129.2k2](/packages/nterms-yii2-mailqueue)[tigrov/yii2-mailqueue

Yii2 mail queue component for yii2-swiftmailer.

186.1k](/packages/tigrov-yii2-mailqueue)

PHPackages © 2026

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