bingooo/laravel-submail

Downloads

25

Stars

2

Version

Laravel-SubMail

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('[email protected]', 'XXXXX');
    $message->to('[email protected]')->cc('[email protected]');
});

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('[email protected]', 'XXXXX');
  $message->to('[email protected]');
});
bingooo

Author

bingooo