定制 dennis-koster/laravel-maileon 二次开发

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

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

dennis-koster/laravel-maileon

Composer 安装命令:

composer require dennis-koster/laravel-maileon

包简介

Maileon mail driver for Laravel

README 文档

README

Software License Latest Version on Packagist GitHub Tests Action Status Coverage Status

This package adds a custom mail driver for Maileon to Laravel.

Some configuration in the Maileon user interface is required.

Requirements

Installation

Install the package:

composer require dennis-koster/laravel-maileon

Publish the configuration file:

php artisan vendor:publish --provider="DennisKoster\\LaravelMaileon\\Providers\\LaravelMaileonServiceProvider"

Add the missing environment variables to your .env file:

MAILEON_API_URL=
MAILEON_API_KEY=
MAILEON_TRANSACTIONAL_CONTACT_EVENT=

Configure Maileon

Maileon does not support sending transactional emails out of the box. We need to take a couple of steps in the Maileon interface to set everything up.

1. Creating the contact event

After logging in, go to "Lists & Contacts" in the top menu. Then click "Contact events" in the left menu, and then click the button "Create a new contact event".

Use the following settings:

Name: API_Transactional
Description: Contact event used for sending transactional emails
Further processing: Enabled
Retention period: 30 Days

Then create these two fields:

Name: subject
Description: Subject of the email
Mandatory: Yes
Format: Text
Name: body_html
Description: The HTML content of the email
Mandatory: Yes
Format: JSON (!! Very important and counter-intuitive)

Image of create custom event

2. Setting up the trigger

Click Mailings in the top menu, and then navigate to "Trigger drafts" in the left menu. Then click the [new trigger draft] button.

Choose the "New content editor" option when prompted.

Enter a name that's easily recognizable like "Transactional mail"

For the subject, click the blue [.] icon to the right side of the input field. Select the type Contact event (transactional). Then select the Contact event we just created (API_Transactional) and select the property subject. Finally, press the [Insert personalization] button.

Image of selecting subject

Enter your sender details and then click the blue Continue button in the right bottom corner.

Choose the "From scratch option".

When presented with the drag and drop editor, click the [Drag & drop editor] button on the bottom left of the screen, and select Code editor.

Remove all contents in the code editor and replace it with the following:

[[TRANSACTION|"body_html[0]"]]

Then click the [Save] button in the top right corner, followed by the X Close button.

Click the blue Contine button again in the bottom right corner of the screen, to go to the Dispatch logic & Approval screen.

For the Mailing logic type, select Single dispatch for an event and then for incident, select the trigger we created (API_Transactional).

Enable Permission neutral sendout.

Image of mailing logic settings

Finally, click the [activate Trigger-mailing] button in the bottom right corner.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固