PHPackages                             aboleon/metaframework-mailer - 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. aboleon/metaframework-mailer

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

aboleon/metaframework-mailer
============================

Mailer infrastructure components for MetaFramework applications

0.4.0(3mo ago)0341MITPHPPHP ^8.3

Since Jan 12Pushed 3mo agoCompare

[ Source](https://github.com/aboleon/metaframework-mailer)[ Packagist](https://packagist.org/packages/aboleon/metaframework-mailer)[ RSS](/packages/aboleon-metaframework-mailer/feed)WikiDiscussions 0.x Synced today

READMEChangelogDependencies (20)Versions (12)Used By (1)

MetaFramework Mailer
====================

[](#metaframework-mailer)

Convenience mailer utilities for Laravel apps. MetaFramework is a collection of small Laravel packages; this one provides a simple base class and wiring so you can define mailer classes, fill view data, and send messages with minimal boilerplate. It includes:

- a `MailerAbstract` base class
- a `MailerMail` Mailable wrapper
- a generator command for mailer classes and Blade views
- an optional HTTP route for dispatching mailers
- localized success/failure messages

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

[](#requirements)

- PHP 8.3+
- Illuminate 12.x components (mail, support, routing, console, filesystem, translation)

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

[](#installation)

Install the package with Composer and rely on Laravel package auto-discovery:

```
composer require aboleon/metaframework-mailer
```

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

[](#configuration)

Publish the config if you want to override defaults:

```
php artisan vendor:publish --tag=mfw-mailer-config
```

Key settings in `config/mfw/mailer.php`:

- `namespaces.default`: base namespace for generated mailers (default `App\Mailer`)
- `views.prefix`: default view prefix for generated mailers (default `mails.mailer`)
- `routes.enabled`: enable the HTTP route (default `false`)

Generate a mailer
-----------------

[](#generate-a-mailer)

Create a mailer class and Blade view:

```
php artisan app:make-mailer Admin/Notification
```

This generates:

- `app/Mailer/Admin/Notification.php`
- `resources/views/mails/mailer/admin/notification.blade.php`

You can override the view name and add translation stubs:

```
php artisan app:make-mailer User/Welcome --view=mails.user.welcome --translations
```

Define a mailer
---------------

[](#define-a-mailer)

Example mailer implementation:

```
