Adds support for newsletter subscriptions using MailerLite.
Features both client-side form support and a server-side API integration for traditional form submissions.
To load this plugin, add the following to the extras
block in your
config.php or
theme settings.php:
'extras' => [
// ...
'mailerlite' => [
'account' => 123456789, // Your MailerLite Account ID
],
// ...
],
The account ID can be located in embedded forms; view a form and scroll down to "Embed form into your website".
The Javascript snippet contains the form ID, example: ml('account', '1234567');
.
This plugin supports a server-side form submission action for forms to subscribe email addresses to.
To enable this, add the following action to your form configuration:
'forms' => [
'contact' => [
'fields' => [
...
],
'actions' => [
[
'action' => 'mailerlite',
'apiKey' => '... your api key ...',
'emailField' => 'email',
'optinField' => 'optin',
]
],
],
],
Integrations
-> API
.To add an embedded form, ensure the account ID is set in the configuration as described above and copy the requested form HTML snippet into the location where you'd like it.
Skip the Javascript snippet! The provided snippet is not compatible with Markdown Master and is not needed, as the plugin will load the required script automatically.