PHPackages                             tompec/laravel-email-log - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tompec/laravel-email-log

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

tompec/laravel-email-log
========================

A Laravel package to log outgoing emails

v1.0.3(6y ago)21.4k2MITPHPPHP ^7.2CI failing

Since Jan 4Pushed 1y ago2 watchersCompare

[ Source](https://github.com/tompec/laravel-email-log)[ Packagist](https://packagist.org/packages/tompec/laravel-email-log)[ Docs](https://github.com/tompec/laravel-email-log)[ RSS](/packages/tompec-laravel-email-log/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (5)Versions (11)Used By (0)

A Laravel package to log emails sent to your users
==================================================

[](#a-laravel-package-to-log-emails-sent-to-your-users)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f2eeb9f8234b87190d8cd3ef1a904dbe9fcb21cb575423e7871bea9a33bdc7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6d7065632f6c61726176656c2d656d61696c2d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tompec/laravel-email-log)[![Build Status](https://camo.githubusercontent.com/033d67ebb867632154638424d39c93fb7e4bffa739ad8bb04f0186796fa54ee0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f6d7065632f6c61726176656c2d656d61696c2d6c6f672f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/tompec/laravel-email-log)[![Quality Score](https://camo.githubusercontent.com/0cabc2f73074214c2d7fdd269bf31feecae60fc647347eab79e5a69decf50162/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f6d7065632f6c61726176656c2d656d61696c2d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tompec/laravel-email-log)[![Coverage](https://camo.githubusercontent.com/c679c8b0c0aea8983041a7030dcfe41d2cfbb8ee1f4904a0c4935b850ba43eb5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f746f6d7065632f6c61726176656c2d656d61696c2d6c6f673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tompec/laravel-email-log)[![StyleCI](https://camo.githubusercontent.com/f45d160da0052c46c5d36324c384c53f0501dff0c2e14b36bfa1d749976fc238/68747470733a2f2f7374796c6563692e696f2f7265706f732f3233313733323431322f736869656c64)](https://styleci.io/repos/231732412)[![Total Downloads](https://camo.githubusercontent.com/c1792d83757f0cdb8dc112c04ba0881ec6c1a38549da4561146682425824153b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d7065632f6c61726176656c2d656d61696c2d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tompec/laravel-email-log)

`laravel-email-log` logs outgoing emails sent to your users. If you use MailGun, you can also track deliveries, failures, opens and clicks.

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

[](#installation)

Install the package via composer:

```
composer require tompec/laravel-email-log
```

If you use Laravel 5.5+, the package will register itself, otherwise, add this to your `config/app.php`

```
'providers' => [
    Tompec\EmailLog\EmailLogServiceProvider::class,
],
```

Run the migration:

```
php artisan migrate
```

Configuration (optional)
------------------------

[](#configuration-optional)

Publish the configuration file:

```
php artisan vendor:publish --provider="Tompec\EmailLog\EmailLogServiceProvider"
```

Here's the content of the config file.

```
return [
    /*
     * This is the name of the table that will be created by the migration.
     */
    'table_name' => 'email_log',

    /*
     * The model that will be attached to the email logs.
     */
    'recipient_model' => \App\User::class,

    /*
     * This is the name of the column that the `recipient_model` uses to store the email address.
     */
    'recipient_email_column' => 'email',

    /*
     * Whether or not you want to log emails that don't belong to any model
     */
    'log_unknown_recipients' => true,
];
```

If you want to get all the email logs for your a user, add this to your `App\User.php` file (or the model you chose as your `recipient_model`):

```
public function email_logs()
{
    return $this->morphMany(\Tompec\EmailLog\EmailLog::class, 'recipient');
}
```

Then you can do `App\User::find(1)->email_logs` to retreive all the emails that this user has received.

Webhooks
--------

[](#webhooks)

If you use [Mailgun](https://www.mailgun.com/), you can track these 4 events: `delivered `, `opened`, `clicked`, `permanent_fail`.

Add the following url [as a new webhook](https://documentation.mailgun.com/en/latest/user_manual.html#webhooks).

```
https://www.yourdomain.com/email-log/mailgun
```

Laravel Nova
------------

[](#laravel-nova)

If you use [Laravel Nova](https://nova.laravel.com/), you can create a new resource to view the content of the table:

```
php artisan nova:resource EmailLog
```

Then paste the content of [this gist](https://gist.github.com/tompec/53108f575aa277102fdcca5e14543c06) for a quick setup.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Thomas Petracco](https://www.tompec.com/) ([GitHub](https://github.com/tompec))
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.3% 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 ~12 days

Recently: every ~21 days

Total

8

Last Release

2230d ago

Major Versions

v0.2.0 → v1.0.02020-01-09

PHP version history (2 changes)v0.1.0PHP ^7.1

v0.1.1PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/534dbb44cb701185263ad1456a9746d241d5d3aee1e34d7ad516942d39e2c35b?d=identicon)[tompec](/maintainers/tompec)

---

Top Contributors

[![tompec](https://avatars.githubusercontent.com/u/17140634?v=4)](https://github.com/tompec "tompec (26 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")

---

Tags

emaillaravelloggingtompeclaravel-email-log

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tompec-laravel-email-log/health.svg)

```
[![Health](https://phpackages.com/badges/tompec-laravel-email-log/health.svg)](https://phpackages.com/packages/tompec-laravel-email-log)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)[directorytree/metrics

Record metrics in your Laravel application

26027.8k](/packages/directorytree-metrics)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)

PHPackages © 2026

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