This plugin allows Mautic to switch between different email services - Sparkpost and Sendgrid. You can use different API keys for the supported email providers based on the API Settings and Product settings.
- Download the master.zip, extract it into the
plugins/
directory, and rename the new directory toCustomEmailSettingsBundle
. - Check the permissions and ownership of the plugin folder, and change them if needed - they should be the same as for other plugins.
- Clear the cache via console command
php bin/console cache:clear --env=prod
(might take a while) OR manually delete thevar/cache/prod
directory.
- Remove the
plugins/CustomEmailSettingsBundle
directory. - Download the master.zip, extract it into the
plugins/
directory, and rename the new directory toCustomEmailSettingsBundle
. - Check the permissions and ownership of the plugin folder, and change them if needed - they should be the same as for other plugins.
- Clear the cache via console command
php bin/console cache:clear --env=prod
(might take a while) OR manually delete thevar/cache/prod
directory. - Run
php bin/console mautic:plugins:install
in the root Mautic directory.
Choose "Multiple Transport" in Configuration / Email Settings
Specify the correct E-mail address to send mail from
and add the API key
which will be used as default (required).
In this section you can set transport and API key for each Email (Channels > Emails). Navigate to the Settings Panel on the right. You should see the "Email Api Keys" menu in your settings:
In the plugin configuration you can add a different API key for the given mail template or you can leave it blank so that the default API key will be used:
Please note:
- It is important to specify the correct
From address
for emails, where the custom API key will be used (Channels > Emails > Edit Email > Advanced tab). - To delete the already configured API key just clear the "key" field and save it;
- If no service is chosen, the default email settings will be used;
- When fresh Mautic setup you need to create at least one email first (Channels > Emails);
In this section you can set transport, API key, and sender parameters to replace the default email settings for each email when it's sending, based on the selected custom field of the Contact (Lead). Select "Multi-Product Settings" on the right Settings panel.
The name of the custom field can be changed in the plugin's config file, by default it is 'domain'.
For example, part of your contacts has 'domain' "usa.mysuperservice.com" and another part - "uk.mysuperservice.com". You can make two config rows with different email settings for 'usa' and 'uk', and send emails from the selected sender through selected transport to each contact, based on its 'domain' field.
Based on the settings on the screenshot below, when sending an email, it will find contact (lead) in the contacts database and check the contact's 'domain' field. If it includes 'usa', the email params will be changed to the ones indicated in the 'usa' configuration on this screenshot, if 'uk' - params from the corresponding row will be taken, if there are no matches - email won't be changed.
Also, you can prioritize the settings - upper config strings have priority over the lower ones. In this example, if the contact has an "usa.mysuperservice.com" 'domain', the email will be sent from [email protected] through Sendgrid. If the next customer has a "pt.mysuperservice.com" or any other domain with "mysuperservice.com", except 'usa' and 'uk' - the email will be sent from [email protected] through Sparkpost.
Please note:
- Multi-Product Settings always have priority over the API Keys settings. So when sending email, it checks the Multi-Product Settings first, if nothing found - Custom API settings. If there are no matches in both configurations - email will be sent through the default email service indicated in the main settings.
- You can use any custom field - just change the 'product_field_name' parameter in the plugin's config file. Make sure this field exists in your Contact (Lead) custom fields.