phper666/laravel-submail

dev-master 2019-11-04 06:12 UTC

This package is auto-updated.

Last update: 2024-11-04 18:04:05 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');
});