定制 mathieu-bour/laravel-mailjet 二次开发

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

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

mathieu-bour/laravel-mailjet

Composer 安装命令:

composer require mathieu-bour/laravel-mailjet

包简介

Mailjet Integration for Laravel and Lumen frameworks

README 文档

README

GitHub license Packagist Version Packagist GitHub issues GitHub pull requests Scrutinizer code quality

Allow to use the Mailjet Templating Language in Laravel mailables.

This package is not supported by Mailjet.

This package follows the Semantic Versioning specification.

Prerequisites

  • PHP >= 7.2
  • Laravel/Lumen 6 or 7

Compatibility matrix

laravel-mailjet Laravel / Lumen
^1.0.0 ^6.0 || ^7.0

Installation / configuration

Simply add the package to your dependencies.

composer require mathieu-bour/laravel-mailjet

Laravel

The package support the Package Discovery.

Lumen

Add the service provider to your bootstrap/app.php.

Configuration

In the config/services.php, add the following entry:

return [
    // ...
    'mailjet'   => [
        'key'     => 'your-mailjet-key',
        'secret'  => 'your-mailjet-secret',
        'call'    => true, // can be set to false to mock requests
        'options' => ['version' => 'v3.1'], // additional Mailjet options, see https://github.com/mailjet/mailjet-apiv3-php#options
    ],
    // ...
];

Usage

You can now use the class Windy\Mailjet\MailjetTemplateMailable as a base for your emails.

Example:

use Windy\Mailjet\MailjetTemplateMailable;

class PasswordForgottenMail extends MailjetTemplateMailable
{
    /** @var int The Mailjet Template ID. */
    protected $templateId = 1185614;
    public $firstName;
    public $resetLink;

    public function __construct(User $user)
    {
        // You can now use {{var:firstName}} and {{var:resetLink}} variables in your Mailjet templates
        $this->firstName = $user->firstname ?? $user->username ?? '';
        $this->resetLink = 'https://mysite.com/password-reset?token=' . $user->token;
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固