Thanks to visit codestin.com
Credit goes to mtcextendee.com

Multiple Transport

Compatible with Mautic 4, 5, 6, and 7.

Manage and use multiple email transports in Mautic with just a few clicks.

  • Assign per Email — Choose a different transport for each email you send.
  • Assign per User — Set a custom transport for each user (contact owner).
  • Use Owner's Transport — Let emails use the contact owner's transport automatically.
  • Easy Setup — Add, edit, and test unlimited transports (SMTP, Amazon SES, Mailjet, Sendgrid, and more).
  • API Ready — Automate everything with a simple API.

Installation

Step 1: Copy the plugin

Place the plugin folder in plugins/MauticMultipleTransportBundle

Step 2: Clear cache

php bin/console cache:clear

Step 3: Reload plugins list

php bin/console mautic:plugins:reload

Step 4: Re-generate assets

php bin/console mautic:assets:generate

After installation, go to Settings > Plugins in Mautic and make sure the plugin is enabled.

How to Use

Before you start: Add at least one transport in the "Multiple Transport" section. If something doesn't work, try clearing the Mautic cache.

Step 1: Assign a Transport to an Email

  1. Open the email edit screen in Mautic.
  2. Find the "Transport" dropdown.
  3. Pick the transport you want for this email.
  4. Save the email.
Mautic email edit screen showing the transport dropdown and owner custom transport option

Step 2: Use Contact Owner's Transport

  1. In the email edit screen, turn on "Use Owner Custom Transport".
  2. The email will use the transport set for the contact's owner (user).
Mautic contact details screen showing the Contact owner field highlighted

Step 3: Assign a Transport to a User

  1. Go to the user profile edit screen.
  2. Find the "Transport" dropdown.
  3. Pick the transport for this user.
  4. Save the user.
Mautic user profile screen showing the Use Custom Transport dropdown

Step 4: Add or Edit Transports

  1. Go to the "Multiple Transport" section in the Mautic admin menu.
  2. Click "New" to add a transport, or edit an existing one.
  3. Fill in the details (name, DSN, etc).
  4. Save.

Step 5: Remove or Reset a Transport

  • To remove a transport from an email or user, set the dropdown to blank and save.
  • If no transport is set, Mautic will use the default transport.

Step 6: Test a Transport

  • When editing a transport, use the "Test" button to send a test email and check if it works.
Mautic transport edit screen showing the Send test email button

Tip: If a transport is not working, double-check the DSN and credentials. If changes are not applied, clear the Mautic cache. Make sure you have permission to manage transports.

FAQ

How can I send emails with the contact owner's transport?

Assign a transport to the user (owner) in their profile. Then, in the email settings, turn on "Use Owner Custom Transport".

Can I use a different transport other than SMTP?

Yes, you can use any transport supported by Mautic, like SMTP, Amazon SES, Mailjet, Sendgrid, and more.

How do I test if a transport works?

Edit the transport and click the "Test" button. A test email will be sent.

What happens if no transport is set for an email or user?

Mautic will use the default transport from your main configuration.

Is this plugin compatible with all Mautic versions?

Yes, it works with Mautic 4 (SMTP only), and Mautic 5, 6, and 7 (all transports).

API Reference

The Multiple Transport plugin extends the Mautic API, allowing you to manage your custom mail transports programmatically.

All API endpoints are prefixed with your Mautic instance URL: https://your-mautic-instance.com/api/multipleTransports

Authentication: Use OAuth2 (Authorization: Bearer YOUR_ACCESS_TOKEN) or Basic Auth.

GET /api/multipleTransports

List all configured transports.

curl -X GET https://your-mautic-instance.com/api/multipleTransports \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
[{ "id": 1, "name": "Amazon SES", "mailerDsn": "ses+smtp://KEY:SECRET@default", "isPublished": true }]

GET /api/multipleTransports/{id}

Get a specific transport by ID.

POST /api/multipleTransports/new

Create a new transport.

{
  "name": "Sendgrid",
  "description": "Sendgrid SMTP",
  "mailerDsn": "smtp://apikey:SG.xxxxx@default",
  "testedEmailFrom": "[email protected]",
  "isPublished": true
}

PATCH /api/multipleTransports/{id}/edit

Update an existing transport. Send only the fields you want to change.

DELETE /api/multipleTransports/{id}/delete

Permanently remove a transport.

POST /api/multipleTransport/transportEmail/{emailId}

Assign a transport to a specific email.

{ "transportId": 2, "useOwnerTransport": false }

POST /api/multipleTransport/transportUser/{userId}

Assign a transport to a specific user.

{ "transportId": 2 }

POST /api/multipleTransports/send/test/{id}

Send a test email using the specified transport.

{ "success": true, "message": "Test email sent" }

API Path Summary

Operation Method Path
List all transports GET /api/multipleTransports
Get specific transport GET /api/multipleTransports/{id}
Create transport POST /api/multipleTransports/new
Update transport PATCH /api/multipleTransports/{id}/edit
Delete transport DELETE /api/multipleTransports/{id}/delete
Assign to email POST /api/multipleTransport/transportEmail/{emailId}
Assign to user POST /api/multipleTransport/transportUser/{userId}
Test transport POST /api/multipleTransports/send/test/{id}

Note: Some endpoints use multipleTransport (singular) while others use multipleTransports (plural). This is the actual API implementation.