Skip to content

MailerLite Automations

How to Update a MailerLite Subscriber's Custom Fields When a Product Is Purchased

Segments are only as good as the data behind them. Zapify can write what a customer just bought into their MailerLite record, with the A product is purchased trigger and the Update a subscriber's custom fields 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: Update a subscriber's custom fields (MAILERLITE_UPDATE_FIELDS, MailerLite)

When the product is bought, Zapify writes the values you chose into the customer's MailerLite record. Only the fields you list are changed.

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.
  • The custom fields created in MailerLite, and the customer already a subscriber — this guide adds them.

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 Update MailerLite fields after a purchase.

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 a product, or leave it as Any.

Step 4: Add the "Update a subscriber's custom fields" action

  1. Click Add Action.

Add an action

  1. Choose MailerLite as the app.

Select MailerLite as the action

  1. Select Update a subscriber's custom fields.

Select Update a subscriber's custom fields

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.
Custom fields Yes One row per field. The key is the MailerLite field's key, such as last_product, and the value is a token, such as Product names. Add last_order_total with Order total the same way.

Create the fields in MailerLite first, under Subscribers → Fields. A key MailerLite does not recognise may be refused or ignored, so check Zapify → Logs after your first test.

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 as a customer who is already a subscriber. Check their fields in MailerLite, or Zapify → Logs, which shows …'s custom fields were updated.

Tokens you can use

Token What it holds
Billing email The customer's email address.
Product names / Order number / Order total What was bought.

The action makes one token available to later actions: Subscriber ID.

Conclusion

With the A product is purchased trigger and the Update a subscriber's custom fields action, MailerLite always knows what each customer last bought. Put both in one automation with adding the customer to a group if you want them added first.

FAQs

Is this free in Zapify?

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

Does it create the subscriber if they are missing?

No, on purpose. An automation meant to update a record should not silently make one. The run fails and says the address is not a subscriber. Use Add or update a subscriber if you want someone created.

Why was one field left alone?

Zapify skips a field whose value is empty, so a token that resolved to nothing cannot blank what is already there.

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?