Crowdskout / e50-mail-laravel by futurityverb

Laravel email facade with support for multiple Mailgun domains.
524
0
14
Package Data
Maintainer Username: futurityverb
Maintainer Contact: willdurney@gmail.com (Will Durney)
Package Create Date: 2015-02-26
Package Last Update: 2018-07-12
Home Page:
Language: PHP
License: GPL-3.0-only
Last Refreshed: 2024-11-22 03:01:24
Package Statistics
Total Downloads: 524
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 0
Total Watchers: 14
Total Forks: 0
Total Open Issues: 0

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' => 'john@example.com',
        'toName' => 'John Doe',
        'fromEmail' => 'robot@example.com',
        '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',
    ]
);