定制 therobfonz/laravel-mandrill-driver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

therobfonz/laravel-mandrill-driver

最新稳定版本:6.1.0

Composer 安装命令:

composer require therobfonz/laravel-mandrill-driver

包简介

Mandrill Driver for Laravel

README 文档

README

This package re-enables Mandrill driver functionality using the Mail facade in Laravel 6+.

To install the package in your project, you need to require the package via Composer:

composer require therobfonz/laravel-mandrill-driver

To add your Mandrill secret key, add the following lines to config\services.php and set MANDRILL_KEY in your env:

'mandrill' => [
    'secret' => env('MANDRILL_KEY'),
],

You can also add custom Mandrill headers to each email sent, for this you need to add the headers array in the following format to config\services.php:

'mandrill' => [
    'secret' => env('MANDRILL_KEY'),
    'headers' => [
        'header-example-x' => env('MANDRILL_HEADER_X'),
        'header-example-y' => env('MANDRILL_HEADER_Y'),
    ]
],

all the valid options in Mandrill docs at: https://mailchimp.com/developer/transactional/docs/smtp-integration/#customize-messages-with-smtp-headers

Accessing Mandrill message ID

Mandrill message ID's for sent emails can be accessed by listening to the MessageSent event. It can then be read either from the sent data or the X-Message-ID header.

Event::listen(\Illuminate\Mail\Events\MessageSent::class, function($event)
{
    $messageId = $event->sent->getMessageId();
    $messageId = $event->message->getHeaders()->get('X-Message-ID');
}
 

Versions

Laravel Version Mandrill package version
11 12
10 5.x
9 4.x
6, 7, 8 3.x

Add the Mandrill mailer to your config\mail.php:

'mandrill' => [
    'transport' => 'mandrill',
],

Set the MAIL_MAILER value in your env to mandrill to enable it:

MAIL_MAILER=mandrill

Laravel 6 Installation

As before, you can set the MAIL_DRIVER value in your env to mandrill to enable it:

MAIL_DRIVER=mandrill

Lumen Installation

Add the following line to bootstrap/app.php

$app->register(LaravelMandrill\MandrillServiceProvider::class);

统计信息

  • 总下载量: 3.36M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 77
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 77
  • Watchers: 3
  • Forks: 40
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-03