定制 toyosi12/laravel-plunk 二次开发

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

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

toyosi12/laravel-plunk

Composer 安装命令:

composer require toyosi12/laravel-plunk

包简介

Plunk is the afforable, developer-friendly email platform that brings together marketing, transactional and broadbase emails into one single, complete solution

README 文档

README

Issues Forks Stars

A laravel package to easily integrate plunk

Installation

PHP 7.2+ and Composer are required.

To get the latest version of Laravel Plunk, simply require it

composer require toyosi12/laravel-plunk

Once installed, the package automatically registers its service provider and facade.

Usage

1. Update your environment file with your secret key as described below.

PLUNK_SECRET_KEY="<SECRET_KEY>"

Login to your Plunk dashboard to obtain your secret key.

2. Make a call to the method you need.

use Toyosi12\Plunk\Facades\Plunk;
Plunk::countContacts();

References

Events

  • triggerEvent() Used to publish an event

Parameters

  • event: The name of the event to publish
  • email: The email address of the user to publish the event to
  • data [Optional]: An object containing the data to attach to the user

Sample request:

use Toyosi12\Plunk\Facades\Plunk;
$request = {
    "event": "test-project",
    "email": "toyosi@nomail.com"
}
Plunk::triggerEvent($request);

Emails

  • sendTransactionalEmail() Used to send transactional email

Parameters

  • to: The email address of the recipient
  • subject: The subject of the email
  • body: The body of the email
  • type [Optional]: The type of email to send (html or markdown)
  • from [Optional]: The email address of the sender
  • name [Optional]: The name of the sender
  • withUnsubscribe [Optional]: Whether to include an unsubscribe link hosted by Plunk in the email

Sample request:

use Toyosi12\Plunk\Facades\Plunk;
$request = {
    "to": "toyosi@nomail.com",
    "subject": "Test Plunk",
    "body": "Testing plunk"
}
Plunk::sendTransactionalEmail($request);

Contributing

Do feel free to fork this repo and contribute by submitting a pull request. Let's make it better.

Star

I'd love you to star this repo. Also follow me on twitter

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-29