How is your experience with the OutSystems Community?
mailerlite-connector
Service icon

Mailerlite Connector

Stable version 2.0.0 (Compatible with OutSystems 11)
Uploaded
 on 24 Nov (3 days ago)
 by 
5.0
 (1 rating)
mailerlite-connector

Mailerlite Connector

Details
Connect OutSystems 11 apps to MailerLite: manage subscribers, groups, segments, fields, campaigns, automations, forms, webhooks and e-commerce shops through the current MailerLite API.
Read more

Requirements

  • OutSystems 11 (11.8 or later).
  • A MailerLite account on the current platform (connect.mailerlite.com).
  • No other Forge dependencies.


API token setup

  1. In MailerLite, open Integrations, then MailerLite API, and click Generate new token.
  2. Give the token a name and copy it. MailerLite shows it only once.
  3. The token has the permissions of the user who created it.


Configuration (Service Center, module MailerliteConnector, Site Properties)

  • ApiToken (Secret): the MailerLite API token.


Set it in each environment. Never put the token in code, in client variables or in inputs that come from the browser.

How to use

  1. In your module, open Manage Dependencies, select MailerliteConnector and add the actions and structures you need.
  2. Call the action from server-side logic and check Success.
  3. When Success is False, read ErrorCode and ErrorMessage. ResponseJSON has the full MailerLite answer, including validation errors per field.

Check the connection:

  • Call Ping. Success = True means the token is valid. ErrorCode 401 means it is missing or wrong.

Add a subscriber to a group:

  • Call CreateOrUpdateSubscriber with Subscriber.Email = "ana@example.com" and Subscriber.Groups = a list with the group id.
  • Fields.Name = "Ana" sets a default field.
  • CustomFieldsJSON = {"plan":"pro"} sets custom fields by key (see ListFields).

List all subscribers:

  • Call ListSubscribers with Limit = 100.
  • Repeat with Cursor = NextCursor while NextCursor is not empty.

Send a campaign:

  1. Call ListGroups to get the group id.
  2. Call CreateCampaign with Campaign.Name, Campaign.Type = "regular", one item in Campaign.Emails (Subject, FromName, From, Content) and Campaign.Groups.
  3. Call ScheduleCampaign with CampaignId = Response.Id and Schedule.Delivery = "instant". For a future date, use Delivery = "scheduled" and fill Schedule.Schedule (Date, Hours, Minutes, TimezoneId from ListTimezones).

Options without a typed input:

  • Use AdditionalJSON to add raw JSON members to the request body. For example: "enabled":false to disable a webhook, or "ab_settings":{...} for A/B campaigns.


Demo app (MailerliteDemo)

  • Setup: token steps, connection test (Ping) and a map of the demo.
  • Subscribers and Subscriber: list by status with cursor pagination, lookup, upsert, edit, groups, activity log, delete, GDPR forget.
  • Groups and Group: create, search, rename, delete, members, add a subscriber, bulk import with progress.
  • Segments & fields, Campaigns and Campaign (draft, send now or schedule, cancel, delete, HTML preview, subscriber activity), Automations, Forms & webhooks, Advanced (batch, timezones, languages, e-commerce).
  • Every screen shows the last call: operation, HTTP status, error message, rate-limit hint and the raw JSON response.
  • The demo acts on your real MailerLite account. Use a test account or test email addresses.


Supported methods

  • Account: Ping, ListTimezones.
  • Subscribers: ListSubscribers, GetSubscribersCount, GetSubscriber, CreateOrUpdateSubscriber, UpdateSubscriber, DeleteSubscriber, ForgetSubscriber, GetSubscriberActivity, GetImportStatus.
  • Groups: ListGroups, CreateGroup, UpdateGroup, DeleteGroup, ListGroupSubscribers, AssignSubscriberToGroup, UnassignSubscriberFromGroup, ImportSubscribersToGroup.
  • Segments: ListSegments, ListSegmentSubscribers, UpdateSegment, DeleteSegment.
  • Fields: ListFields, CreateField, UpdateField, DeleteField.
  • Campaigns: ListCampaigns, GetCampaign, CreateCampaign, UpdateCampaign, ScheduleCampaign, CancelCampaign, DeleteCampaign, GetCampaignSubscriberActivity, ListCampaignLanguages.
  • Automations: ListAutomations, GetAutomation, GetAutomationActivity, CreateAutomation, UpdateAutomation, EnableAutomation, DisableAutomation, CopyAutomation, AddSubscribersToAutomation, DeleteAutomation.
  • Forms: ListForms, GetForm, UpdateForm, DeleteForm, ListFormSubscribers.
  • Webhooks: ListWebhooks, GetWebhook, CreateWebhook, UpdateWebhook, DeleteWebhook.
  • Batch: SendBatch.
  • E-commerce: ListShops, GetShop, CreateShop, UpdateShop, DeleteShop, GetShopStats, GetCampaignEcommerceReport.
  • Emails: GetEmailHtml.


Error handling

  • ErrorCode is the HTTP status returned by MailerLite:
    • 401: token missing or invalid;
    • 403: not allowed for this account or token;
    • 404: not found;
    • 422: invalid data (details per field in ResponseJSON);
    • 429: rate limit (120 requests per minute, 5 imports per minute). Wait RetryAfter seconds;
    • 5xx: MailerLite error. Try again later.
  • ErrorCode -1 means an unexpected error, for example a timeout. ErrorMessage has the exception message and the error is logged.


Notes

  • Ids are Text, as returned by the API.
  • Empty and False values are not sent, so they keep the MailerLite defaults. Use AdditionalJSON to send an explicit false.
  • Webhook signatures (Signature header, HMAC-SHA256 of the body with the webhook secret) must be checked in the app that receives the webhook.
  • Upgrading from 1.0.0: replace the old site properties with ApiToken, then review each call (new names, Text ids, new outputs).


Links

Release notes (2.0.0)
Version 2.0.0

New
  • Moved to the current MailerLite API (connect.mailerlite.com/api) with Bearer token authentication. The classic API (api.mailerlite.com/api/v2) is no longer used.
  • 65 public actions (19 before): new areas are segments, fields, automations, forms, webhooks, batch, timezones, campaign languages, e-commerce shops and email HTML.
  • Subscribers: count, update, delete, GDPR forget, activity log, import status. Groups: bulk import.
  • Campaigns: update drafts, scheduled and timezone-based delivery, subscriber activity, languages.
  • Pagination outputs: NextCursor/PrevCursor for cursor lists, CurrentPage/LastPage/Total for page lists.
  • AdditionalJSON on every request with a body, for options without a typed input. Fields and CustomFieldsJSON on subscribers.
  • New demo app (MailerliteDemo): one screen per area, every action, HTTP status and raw JSON of each call.
  • Descriptions on every action, parameter, structure, attribute and site property.

Improved
  • Consistent outputs on every action: Success, ErrorCode (HTTP status), ErrorMessage, RetryAfter (429) and ResponseJSON. Errors no longer raise exceptions.
  • Timeouts per method (30 s, 60 s for batch and import).

Security

The API key is no longer stored in the module. The token is read from the Secret site property ApiToken.

Breaking changes
  • Not compatible with 1.0.0. Ids are Text; structures and outputs changed.
  • Renamed actions: GetSubscribers > ListSubscribers, GetSubscriberById > GetSubscriber, CreateUpdateSubscriber > CreateOrUpdateSubscriber, GetGroups > ListGroups, GetSubscribersFromGroup > ListGroupSubscribers, AddSubscriberToGroup > AssignSubscriberToGroup, RemoveSubscriberFromGroup > UnassignSubscriberFromGroup, GetCampaigns > ListCampaigns, GetCampaignById > GetCampaign, SendCampaign > ScheduleCampaign.
  • Removed: GetGroupById and GetGroupsOfSubscriber (no equivalent in the new API; use ListGroups and GetSubscriber.Groups), the CampaignStatus static entity, the MailerliteException exception and the TenantId/TenantName site properties.
  • Structure Groupp renamed to Group.

Upgrading from 1.0.0
  1. Create a token in MailerLite (Integrations > MailerLite API) and set ApiToken in Service Center.
  2. Refresh the dependency and fix each call: new names, Text ids, new outputs.
  3. Replace exception handlers with checks on Success and ErrorCode.
License (2.0.0)
Reviews (0)
Team
Other assets in this category