Skip to content

MailerLite Automations

How to Add a WooCommerce Customer to MailerLite When a Product Is Purchased

Buyers of a product are a ready-made group for care tips, upgrades and review requests. Zapify can add them to MailerLite the moment they buy, with the free A product is purchased trigger and the Add or update a subscriber action. MailerLite is a Zapify PRO integration.

What this automation does

The automation is one trigger plus one action:

  • Trigger: A product is purchased (WC_PRODUCT_PURCHASED, WooCommerce)
  • Action: Add or update a subscriber (MAILERLITE_UPSERT_SUBSCRIBER, MailerLite)

When the chosen product is bought, Zapify adds the buyer's billing email to MailerLite with their details and your group, or updates their subscriber if they exist.

Before you start

  • WooCommerce installed and active.
  • A MailerLite account (the current MailerLite, not MailerLite Classic).
  • A MailerLite API key — create one in MailerLite under Integrations → API. MailerLite's own page for it is here.
  • A group in MailerLite for these customers.

PRO feature

MailerLite is a Zapify PRO integration and needs a Connection under Settings → Connections. The A product is purchased trigger used here is free.

How to build the automation

Step 1: Connect MailerLite

  1. Go to Settings → Connections and click Add New.

Open the Connections tab

  1. Choose MailerLite, paste in your API key, and name the connection something like Newsletter MailerLite.

Add the MailerLite connection

  1. Click Test. Zapify asks MailerLite to accept the key and answers MailerLite accepted the credentials. If the key is wrong it says MailerLite refused the credentials. instead, so you find out before building anything.
  2. Save.

See Connections for how this screen works generally.

Step 2: Create a new automation

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Add buyers to MailerLite.

Create a new automation

Step 3: Add the "A product is purchased" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose WooCommerce as the app.

Select WooCommerce as the trigger

  1. Select A product is purchased.

Select A product is purchased

  1. In the Product field, choose the product that should start the automation.

Step 4: Add the "Add or update a subscriber" action

  1. Click Add Action.

Add an action

  1. Choose MailerLite as the app.

Select MailerLite as the action

  1. Select Add or update a subscriber.

Select Add or update a subscriber

Step 5: Configure the action

Field Required What it does
Connection Yes The MailerLite connection from Step 1.
Email address Yes Insert the Billing email token.
First name / Last name No Insert Billing first name and Billing last name.
Custom fields No Add a row with the key phone and the Billing phone token. The key is the MailerLite field's key, which you can see under Subscribers → Fields in MailerLite.
Groups No The group for buyers of this product, such as Customers.
Status No Leave on Active. For an existing subscriber this leaves their status alone, and a new subscriber gets your MailerLite account's default.
Resubscribe No Leave off. Ticking it re-subscribes somebody who had unsubscribed — only do that where you have their fresh consent.

Step 6: Set the steps Live and save

Each trigger and action has its own Live / Off / Draft switch. A new automation starts as a Draft and does nothing until its steps are Live.

  1. Set the trigger and every action to Live.
  2. Click Save.

Set the automation live

Step 7: Test it

Place a test order for the product. Check the subscriber and their group in MailerLite, or Zapify → Logs.

Tokens you can use

Token What it holds
Billing email / first name / last name / phone The customer's details from the order.
Product names / Order number / Order total What was bought. Put them in a custom field if you created one in MailerLite.

The action makes two tokens available to later actions: Subscriber ID and Subscriber status.

Conclusion

With the A product is purchased trigger and the Add or update a subscriber action, buyers join the right MailerLite group as they pay. To keep their record fresh after later orders, see updating MailerLite custom fields when a product is purchased.

FAQs

Is this free in Zapify?

The trigger is free. The MailerLite actions need an active Zapify PRO licence and a Connection.

Does it work for guest checkouts?

Yes. The billing email is on the order, so an account is not needed.

A purchase is not always consent. If you need it, only continue when a checkout checkbox is ticked. See Filters and conditions.

Why was a custom field left empty in MailerLite?

Zapify skips a field whose value is empty, so a token that resolved to nothing cannot blank what is already there. The field must also exist in MailerLite first, under Subscribers → Fields.

Why is my new group or custom field not in the dropdown?

Zapify keeps the groups and fields it reads from MailerLite for a minute, so the builder does not call MailerLite on every dropdown. Wait a moment and reopen the field. If the dropdown stays empty, use Test on the connection, because an unreachable MailerLite gives an empty list.

Does this work with MailerLite Classic?

No. Zapify uses MailerLite's current API, and the older Classic API is not supported. Create the API key in the current MailerLite under Integrations → API.

Do I need to write any code?

No. The API key is the only thing you copy from outside Zapify.

Was this page helpful?