homicity/laravel-mandrill

一个用于使用 Mandrill 模板的 Laravel 邮件宏

101 2018-11-21 18:58 UTC

This package is auto-updated.

Last update: 2024-09-12 00:49:39 UTC


README

安装

composer require homicity/laravel-mandrill

然后发布配置文件

php artisan vendor:publish --provider="Homicity\MandrillMailable\Providers\MandrillMailableServiceProvider" --tag="config"

配置

将其添加到您的 .env 文件中

MANDRILL_SECRET={your mandrill api key}
MANDRILL_FROM_EMAIL={your from email address}
MANDRILL_FROM_NAME={your from name}

用法

Mail::mandrill()
    ->to('john@example.com')
    ->name('John Doe')
    ->templateName('template-name')
    ->fromEmail('no-reply@example.com')
    ->fromName('Example Website')
    ->subject('Hello Mandrill')
    ->send();