定制 mograine/laravel-sendinblue-template 二次开发

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

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

mograine/laravel-sendinblue-template

最新稳定版本:v1.3.3

Composer 安装命令:

composer require mograine/laravel-sendinblue-template

包简介

A Laravel 7/8/9 service provider, facade and config file for the SendinBlue's API v3 official PHP library.

README 文档

README

Latest Version on Packagist Total Downloads License

The package simply provides a Laravel service provider, facade and config file for the SendinBlue's API v3 official PHP library. https://github.com/sendinblue/APIv3-php-library

It also allow to simply send a laravel notification using a SendInBlue transactional template.

Installation

You can install this package via Composer using:

composer require mograine/laravel-sendinblue-template-template

Configuration

You need to publish the config file to app/config/sendinblue.php. To do so, run:

php artisan vendor:publish --tag=sendinblue.config

Now you need to set your configuration using environment variables. Go the the Sendinblue API settings and add the v3 API key to your .env file.

SENDINBLUE_API_KEY=xkeysib-XXXXXXXXXXXXXXXXXXX
SENDINBLUE_EMAIL=defaultEmail
SENDINBLUE_NAME=defaultName

Usage

This package provide a built-in notification channel to send transactional template emails.

To test it, create a new notification using the php artisan make:notification command.

Example of usage :

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Mograine\Sendinblue\SendinblueMailTemplateChannel;
use Mograine\Sendinblue\TemplateMessage;

class NewOfferNotification extends Notification
{
    use Queueable;

    public function via($notifiable)
    {
        return [ SendinblueMailTemplateChannel::class ];
    }

    public function toMailTemplate($notifiable): TemplateMessage
    {
        $templateId = 1;
        $templateMessage = new TemplateMessage($templateId);
        $templateMessage->attribute('USER_EMAIL', $notifiable->email);
        return $templateMessage;
    }
}

You can also get any V3 SendInBlue API using the built-in getAPI method :

use Mograine\Sendinblue\SendinblueApiEnum;
use Mograine\Sendinblue\Facades\Sendinblue;

// We first get the API we want
$transactionalApi = Sendinblue::getApi(SendinblueApiEnum::TransactionalEmailsApi);

// We can then easily use it, example :
$transactionalApi->deleteBlockedDomain('exampleSendinblueDomain.com');

Be sure to visit the SendinBlue official documentation website for additional information about the API.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

License

license. Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固