PHPackages                             kirschbaum-development/nova-mail - 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. kirschbaum-development/nova-mail

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

kirschbaum-development/nova-mail
================================

A Laravel Nova action for sending mail.

4.9.0(4y ago)7488.3k↓73.9%22[6 issues](https://github.com/kirschbaum-development/nova-mail/issues)[1 PRs](https://github.com/kirschbaum-development/nova-mail/pulls)MITPHPPHP &gt;=7.1.0

Since Aug 7Pushed 4y ago14 watchersCompare

[ Source](https://github.com/kirschbaum-development/nova-mail)[ Packagist](https://packagist.org/packages/kirschbaum-development/nova-mail)[ RSS](/packages/kirschbaum-development-nova-mail/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

[![banner](screenshots/banner.png)](screenshots/banner.png)

Nova Mail
=========

[](#nova-mail)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d62aee3e533bacc61861078b3743bcc7e9c50dbdc1097daa2ba9da72beee3fb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b69727363686261756d2d646576656c6f706d656e742f6e6f76612d6d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kirschbaum-development/nova-mail)[![Total Downloads](https://camo.githubusercontent.com/b3b7ec898566aa08c87e0fd309e09ac943e63e6a5f536f464bf11301352e2e5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b69727363686261756d2d646576656c6f706d656e742f6e6f76612d6d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kirschbaum-development/nova-mail)

This package contains a Nova action that provides a mail sending form for any resource to easily send email. It also includes automated mail sending based on Eloquent Model events/attribute changes.

[![screenshot of the send mail action modal](screenshots/send-mail-modal-empty.png)](screenshots/send-mail-modal-empty.png)

[![screenshot of the send mail action modal with template selected](screenshots/send-mail-modal-template-selected.png)](screenshots/send-mail-modal-template-selected.png)

[![screenshot of mail template model events](screenshots/mail-template-model-events.png)](screenshots/mail-template-model-events.png)

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

[](#requirements)

This Nova package requires Nova 4.0 or higher. If you are using a Nova version &lt; 4.0, then you'll want to use [v1.0.4](https://github.com/kirschbaum-development/nova-mail/tree/1.0.4) (no longer updated).

Using the mail delay feature requires a queue driver other than sync. If you are using the Amazon SQS queue service, the maximum delay time is 15 minutes.

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

[](#installation)

You can install this package in a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require kirschbaum-development/nova-mail
```

Next, we need to run migrations. Auto-discovery of this package's service provider helps with that!

```
php artisan migrate
```

And lastly, any model that you want to send mail needs the `Mailable` trait added to it. The model should have a compliant email column. You also need to implement the abstract method provided by the `Mailable` trait, like shown below. You should customize this if your email column name is different:

```
use KirschbaumDevelopment\NovaMail\Traits\Mailable;

class User extends Model
{
    use Mailable;

    /**
     * Get the name of the email field for the model.
     *
     * @return string
     */
    public function getEmailField(): string
    {
        return 'email';
    }

    // ...
}
```

If you would like to publish the config for this package, run:

```
php artisan vendor:publish
```

And choose the provider for this package: `KirschbaumDevelopment\NovaMail\NovaMailServiceProvider`

Usage
-----

[](#usage)

There is a single action (`SendMail`) and two resources (`NovaMailTemplate` and `NovaSentMail`) that ship with this package. Internally the `SendMail` action uses a custom Nova field to display the inline mail sending form.

### SendMail action

[](#sendmail-action)

The `SendMail` action inserts a mail form directly into a Nova action modal. This action allows you to quickly send an email directly to one or more resources.

Simply add the `KirschbaumDevelopment\NovaMail\Actions\SendMail` action to your Nova resource:

```
namespace App\Nova;

use KirschbaumDevelopment\NovaMail\Actions\SendMail;

class User extends Resource
{
    // ...

    public function actions(Request $request)
    {
        return [
            // ...

            new SendMail,
        ];
    }
}
```

Now you can send emails from the action called "Send Mail" on your resource!

You can also delay any outgoing email by setting the delay in minutes property on the template. Like subject and body, you can override the mail delay specified in the template when you send mail.

### Trigger Mail on Model Events

[](#trigger-mail-on-model-events)

A `MailTemplate` can be configured to respond to Eloquent Model events, or a value change of a specified column. For example, a mail template informing your users of their account status could be sent when the `active` column on your `User` model is updated:

[![screenshot of the account status mail template](screenshots/model-event-account-status-change.png)](screenshots/model-event-account-status-change.png)

You can even have separate Model Events for both "on" an "off"!

[![screenshot of the account status with value mail template](screenshots/model-event-account-status-change-with-value.png)](screenshots/model-event-account-status-change-with-value.png)

### Mail Template Usage/Caveats

[](#mail-template-usagecaveats)

The `NovaMailTemplate` resource allows you to create re-usable custom templates for sending email. It works by taking your specified template (or over-ridden template content) and building a temporary blade file (the Blade file can be saved permantely via a configuration option). This blade file is then used in the typical Laravel fashion to send the email.

The final content provided when the user clicks the "Send Mail" button is parsed as markdown and makes no assumptions about newlines or any other formatting for that matter. For example, if you were to use the built in mail message component provided by Laravel for markdown emails you could create a template like the following:

```
@component('mail::message')
Hello {{ $name }},

Visit this link when you have a moment:

[https://github.com/kirschbaum-development/nova-mail](https://github.com/kirschbaum-development/nova-mail)

Let me know if you have any questions.

@include('path.to.footer')
@endcomponent

```

[![screenshot of the create mail template](screenshots/create-mail-template.png)](screenshots/create-mail-template.png)

### Sent Mail Usage

[](#sent-mail-usage)

The `NovaSentMail` resource can be added as a relationship field to any `Resource` that has the `Mailable` trait defined on it's corresponding model. This gives you direct access to the history of emails sent from that `Resource`:

```
namespace App\Nova;

use Laravel\Nova\Fields\HasMany;
use KirschbaumDevelopment\NovaMail\Nova\NovaSentMail;

class User extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            HasMany::make('Sent Mail', 'mails', NovaSentMail::class),

            // ...
        ];
    }
}
```

[![screenshot of the sent mail index](screenshots/nova-sent-mail.png)](screenshots/nova-sent-mail.png)

Resource Customization
----------------------

[](#resource-customization)

In case you need to customize the `Nova Resources` that you're using in your application, for instance, to add filters, cards or add fields. You can change the default set of classes. First, you'll need to override the array of `Resources` found in the config file (If you haven't published a config file yet please see the **Installation** section):

```
    /*
    |--------------------------------------------------------------------------
    | Default Resources
    |--------------------------------------------------------------------------
    |
    | This determines which Nova Resources you're using
    | You can change it as you wish
    |
    */
    'default_resources' => [
        'nova_mail_event' => App\Nova\YourNovaMailEventResource::class,
        'nova_mail_template' => App\Nova\YourNovaMailTemplateResource::class,
        'nova_sent_mail' => App\Nova\YourNovaSentMailResource::class,
    ],
```

After that you can `extends` the default `Resource Class` and add your custom code like this:

```
use KirschbaumDevelopment\NovaMail\Nova\NovaSentMail;

class YourNovaSentMailResource extends NovaSentMail
{
    public function cards(Request $request)
    {
        return [
            // Your custom code...
        ];
    }
}
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Adam Parker](https://github.com/adammparker)
- [Brandon Ferens](https://github.com/brandonferens)
- [Justin Seliga](https://github.com/jrseliga)
- [Belisar Hoxholli](https://github.com/belisarh)

Sponsorship
-----------

[](#sponsorship)

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more [about us](https://kirschbaumdevelopment.com) or [join us](https://careers.kirschbaumdevelopment.com)!

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.2% 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 ~174 days

Recently: every ~128 days

Total

7

Last Release

1474d ago

Major Versions

0.1.0 → 1.0.02020-09-30

1.0.4 → 4.9.02022-06-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f56743d64d77958321d43b2df49e9696d19c9dd99995730c5c38ccae50408fa?d=identicon)[Kirschbaum](/maintainers/Kirschbaum)

---

Top Contributors

[![adammparker](https://avatars.githubusercontent.com/u/5186174?v=4)](https://github.com/adammparker "adammparker (98 commits)")[![brandonferens](https://avatars.githubusercontent.com/u/1819546?v=4)](https://github.com/brandonferens "brandonferens (12 commits)")[![belisarh](https://avatars.githubusercontent.com/u/11684453?v=4)](https://github.com/belisarh "belisarh (11 commits)")[![kirschbaum](https://avatars.githubusercontent.com/u/3734258?v=4)](https://github.com/kirschbaum "kirschbaum (5 commits)")[![wilkerwma](https://avatars.githubusercontent.com/u/4114438?v=4)](https://github.com/wilkerwma "wilkerwma (3 commits)")[![Fijvect](https://avatars.githubusercontent.com/u/12387268?v=4)](https://github.com/Fijvect "Fijvect (2 commits)")[![jrseliga](https://avatars.githubusercontent.com/u/3277067?v=4)](https://github.com/jrseliga "jrseliga (1 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/kirschbaum-development-nova-mail/health.svg)

```
[![Health](https://phpackages.com/badges/kirschbaum-development-nova-mail/health.svg)](https://phpackages.com/packages/kirschbaum-development-nova-mail)
```

###  Alternatives

[inspheric/nova-email-field

A Laravel Nova email field.

33514.2k1](/packages/inspheric-nova-email-field)[coreproc/nova-notification-feed

A Laravel Nova package that adds a notification feed in your Nova app.

10049.3k](/packages/coreproc-nova-notification-feed)[mirovit/nova-notifications

A Laravel Nova tool to display user notifications.

64111.0k1](/packages/mirovit-nova-notifications)[christophrumpel/nova-notifications

A Laravel Nova tool for handling Laravel Notifications.

7626.3k](/packages/christophrumpel-nova-notifications)[dniccum/custom-email-sender

A tool for Laravel's Nova administrator panel that allows you to send custom email messages that within your application that leverages the applications existing settings and configurations.

6236.7k](/packages/dniccum-custom-email-sender)[jstoone/nova-mailman

Conveniently route all emails to a local mailbox.

454.1k](/packages/jstoone-nova-mailman)

PHPackages © 2026

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