LaravelPackages.net
Acme Inc.
Toggle sidebar
elite50/e50-mail-laravel

Laravel email facade with support for multiple Mailgun domains.

526
0
v1.3.0
About elite50/e50-mail-laravel

elite50/e50-mail-laravel is a Laravel package for laravel email facade with support for multiple mailgun domains.. It currently has 0 GitHub stars and 526 downloads on Packagist (latest version v1.3.0). Install it with composer require elite50/e50-mail-laravel. Discover more Laravel packages by elite50 or browse all Laravel packages to compare alternatives.

Last updated

Elite50 E50Mail Laravel Facade

An extension of Laravel's Mail facade allowing for dynamic configuration.

Using the facade

Install via composer

composer require elite50/e50-mail-laravel

Include in app/config/app.php

'providers' => array (
    ...
    'Elite50\E50MailLaravel\E50MailServiceProvider',
),

'aliases' => array (
    ...
    'E50Mail' => 'Elite50\E50MailLaravel\Facades\E50Mail',
    'E50MailWorker' => 'Elite50\E50MailLaravel\E50MailWorker',
)

Use the facade in your application

Example:
E50Mail::queue(
    // Sender domain (required for Mailgun only)
    'example.com',

    // Views
    ['html' => 'views.html-email'],

    // View data
    ['name' => 'John Doe'],

    // Message data
    [
        'toEmail' => '[email protected]',
        'toName' => 'John Doe',
        'fromEmail' => '[email protected]',
        'fromName' => 'Mail Robot',
        'subject' => 'Action Required!',
        'headers' => [
            'X-Mail-Header' => 'abcd1234',
        ],
    ],

    // Custom driver (DEPRECATED - use custom mail config)
    'mailgun',

    // Custom queue
    'QueueName',

    // Custom mail config
    [
        'driver' => 'smtp',
        'host' => 'smtp.myhost.com',
    ]
);
Comments