dennis-koster/laravel-maileon

Maileon mail driver for Laravel
2,463 2
Install
composer require dennis-koster/laravel-maileon
Latest Version:3.0.0
PHP:^8.2
License:MIT
Last Updated:Jul 22, 2024
Links: GitHub  ·  Packagist
Maintainer: denniskoster

Laravel Maileon

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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
3.0.0 ^8.2 ^v10.0.0 MIT
2.0.1 ^8.0 ^9.0 MIT
2.0.0 ^8.0 ^9.0 MIT
1.0.6 ^7.4 || ^8.0 ^8.0 MIT
1.0.5 ^7.4 || ^8.0 ^8.0 MIT