bingooo/laravel-submail

dev-master 2016-03-02 06:44 UTC

This package is auto-updated.

Last update: 2024-04-12 18:05:34 UTC


README

composer require bingooo/laravel-submail

config/app.php

'providers' => [
    Bingooo\Mail\SubMailServiceProvider::class,
];

.env

MAIL_DRIVER=submail

SUBMAIL_APPID=
SUBMAIL_APPKEY=

Normal

Mail::send('emails.welcome', $data, function ($message) {
    $message->from('foo@example.com', 'XXXXX');
    $message->to('foo@example.com')->cc('bar@example.com');
});

Use template:

$vars = ['name' => 'hi','link_text' => 'http://example.com'];
$links = ['link' => 'http://example.com'];
$template = new Bingooo\Mail\SubMailTemplate('XXXXX', $vars, $links);
\Mail::raw($template,function($message){
  $message->from('foo@example.com', 'XXXXX');
  $message->to('foo@example.com');
});