therobfonz/laravel-mandrill-driver 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

therobfonz/laravel-mandrill-driver

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);

therobfonz/laravel-mandrill-driver 适用场景与选型建议

therobfonz/laravel-mandrill-driver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.72M 次下载、GitHub Stars 达 78, 最近一次更新时间为 2019 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「mandrill」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 therobfonz/laravel-mandrill-driver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 therobfonz/laravel-mandrill-driver 我们能提供哪些服务?
定制开发 / 二次开发

基于 therobfonz/laravel-mandrill-driver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.72M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 78
  • 点击次数: 23
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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