hydrarulz/laravel-mandrill-interface 问题修复 & 功能扩展

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

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

hydrarulz/laravel-mandrill-interface

Composer 安装命令:

composer require hydrarulz/laravel-mandrill-interface

包简介

Laravel mandrill interface oriented towards send templates. Because Laravel does not support that out of the box

README 文档

README

Install it with

composer require "hydrarulz/laravel-mandrill-interface:dev-master"

Add the service provider at the end of the providers array in file config/app.php:

'Hydrarulz\LaravelMandrillInterface\LaravelMandrillInterfaceServiceProvider',

The service provider will register an interface, but you should also register the alias at the end of the aliases array:

'LaravelMandrillInterface' => 'Hydrarulz\LaravelMandrillInterface\Facades\LaravelMandrillInterface',

Then the you should publish the config file with php artisan vendor:publish This creates your config file /config/laravel-mandrill-interface.php that looks like this:

<?php

return [
    'token' => env('MANDRILL_TOKEN')
    , 'pretend' => env('MAIL_PRETEND')
];

Add your Mandrill token to the .env file and set the pretend value true of false.

# Mandrill setup
MANDRILL_TOKEN=YOUR_TOKEN_HERE
MAIL_PRETEND=false

After this you can start using it in your application

$message = [
    'to' => [
        [
            'email' => 'example@server.com',
            'name' => 'Daniel Luca',
            'type' => 'to'
        ]
    ]
    , 'global_merge_vars' => [
        [
            'name' => 'VARIABLE_ID'
            , 'content' => '1234'
        ]
    ]
];

$mandrill_interface = LaravelMandrillInterface::getInstance();
$mandrill_interface->sendTemplate(
    'your_template'
    , []
    , $message
    , true
);

Or event the send method.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-29