PHPackages                             mach3builders/mail-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. mach3builders/mail-log

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

mach3builders/mail-log
======================

086↓100%PHP

Since Apr 4Pushed 3y ago9 watchersCompare

[ Source](https://github.com/mach3builders/mail-log)[ Packagist](https://packagist.org/packages/mach3builders/mail-log)[ RSS](/packages/mach3builders-mail-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mail log
--------

[](#mail-log)

[![detail](detail.png)](detail.png)

[![overview](overview.png)](overview.png)

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

[](#installation)

You can install the package via composer:

```
composer require mach3builders/mail-log
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Mach3builders\MailLog\MailLogServiceProvider" --tag="migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Mach3builders\MailLog\MailLogServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'route_path' => 'mails',

    'middleware' => ['web', 'auth'],

    'signing_key' => env('MAIL_LOG_SIGNING_KEY'),

    'keep_mail_for_days' => env('MAIL_LOG_KEEP_FOR_DAYS', 7),

    'mailgun_api_token' => env('MAILGUN_API_TOKEN'),
];
```

### Setting up the webhook

[](#setting-up-the-webhook)

#### Manual

[](#manual)

Go to mailgun.org and setup 3 webhooks: delivered, temporary fail and permanent fail to point at `mails/webhook`. The package won't accept any other webhooks for now.

#### Command

[](#command)

If you want you could use the SetupWebhooksCommand wich triggers a Job that setups the webhooks for you

```
php artisan mail-log:setup-webhooks
php artisan mail-log:setup-webhooks "mach3test.com"
```

It doesnt matter if you choose the command or manual setup route, you will still have the login in too mailgun and go to your webhooks overview. Copy your webhook signing key and update `MAIL_LOG_SIGNING_KEY` in the config.

Usage
-----

[](#usage)

When you require this package it will automaticaly start logging all e-mails sent. Visit `/mails` to view all logged mails.

### Listening for changes

[](#listening-for-changes)

You can listen to `MailUpdated` event to update your own models. You can access `$event->mail` for the updated model.

```
protected $listen = [
        \Mach3builders\MailLog\Events\MailUpdated::class => [
            \App\Listeners\UpdateUserComfirmationEmail::class,
        ]
];

```

### Editting views

[](#editting-views)

To edit the views used publish them and edit to your liking.

```
php artisan vendor:publish --provider="Mach3builders\MailLog\MailLogServiceProvider" --tag="views"
```

### Cleaning up mail logs

[](#cleaning-up-mail-logs)

You can run `php artisan mail-log:clean` command to clean up the mail log. By default this will remove all mails older than 7 days.

If you want to adjust the amount of days to keep email you can adjust it in the config. or you caan update the .env file `MAIL_LOG_KEEP_FOR_DAYS=365`.

### Running the cleanup on a schedule

[](#running-the-cleanup-on-a-schedule)

```
//app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
   $schedule->command('mail-log:clean')->daily();
}
```

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.9% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c933de3316dff6b15b9b876af2f0a9719f27df19223b1f4aa801fcd0f30eb09?d=identicon)[Mach3Builders](/maintainers/Mach3Builders)

---

Top Contributors

[![robbinbenard](https://avatars.githubusercontent.com/u/7994939?v=4)](https://github.com/robbinbenard "robbinbenard (16 commits)")[![ao-jhelmich](https://avatars.githubusercontent.com/u/17061364?v=4)](https://github.com/ao-jhelmich "ao-jhelmich (2 commits)")

### Embed Badge

![Health badge](/badges/mach3builders-mail-log/health.svg)

```
[![Health](https://phpackages.com/badges/mach3builders-mail-log/health.svg)](https://phpackages.com/packages/mach3builders-mail-log)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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