⌘I

Add subscribers to MailerLite

Updated July 14, 2023 ·
pluginsformspree-climailerlite
Also available in:

The add subscriber action adds subscribers to MailerLite. Under the hood, this action calls the create subscriber API endpoint. Also, you may want to add the subscriber to a group.

Adding the add subscriber action in the formspree.json file has the same effect as adding the MailerLite plugin in the Formspree dashboard. See the MailerLite plugin help article for more information.

Formspree.json configuration

KeyTypeDescription
appStringMust be mailerlite
apiKeyStringYour MailerLite API key found here (must be an $ env variable reference, required)
typeStringMust be addSubscriber
groupNameStringOptional. Group where subscribers will be added. Default: empty
resubscribeBooleanOptional. Reactivates the subscriber if the value is true. Default: false
autorespondersBooleanOptional. Enable subscription autoresponders. Only takes effect if groupName is not empty. Default: false
subscriberStatusEnumOptional. One of unsubscribed, active, or unconfirmed. Default: active
requireOptinBooleanOptional. If true, enables the opt-in field: Submissions will only be sent to MailerLite if there is a field named _optin with a non-empty value in the data. Default: false

Notes

autoresponders: This only takes effect if a group is selected. If it’s enabled, the selected group autoresponders will be sent.

resubscribe: If it’s enabled and the sent email is on your subscriber list, the Subscriber Status will be ignored and the subscriber reactivated.
Be aware that it only works for emails that once have been added to your subscriber list. For new emails, the Subscriber Status will be taken instead.

requireOptin: Instead of adding a contact to the MailerLite list each time the form is submitted, the Opt-in Checkbox setting will first check the presence of an _optin special field to determine if the plugin should be dispatched.

Example

{
  "forms": {
    "contact": {
      "name": "Contact Form",
      "actions": [
        {
          "app": "mailerlite",
          "apiKey": "$MAILERLITE_API_KEY",
          "type": "addSubscriber",
          "groupName": "Formspree Test",
          "resubscribe": false,
          "autoresponders": false,
          "subscriberStatus": "active",
          "requireOptin": false
        }
      ]
    }
  }
}

Validation rules

The add subscriber action adds the following validation rules implicitly:

FieldValidation Rule
_replyto or emailRequired
_replytoType is email
emailType is email

Still have questions? or .