Skip to content

AffiliateWP Automations

How to Email an Affiliate When Their Commission Is Approved in AffiliateWP

A referral is only real once the order behind it has gone through. To email an affiliate when their commission is approved in AffiliateWP, use Zapify's An affiliate's referral changes status trigger set to Unpaid with the Send an email action. AffiliateWP is a Zapify PRO integration.

What this automation does

The automation is one trigger plus one action:

  • Trigger: An affiliate's referral changes status (AFFWP_REFERRAL_STATUS_CHANGED, AffiliateWP)
  • Action: Send an email (WP_SEND_EMAIL, WordPress)

When a referral moves to Unpaid, which means it is confirmed and ready to be included in the next payout, Zapify emails the affiliate with the amount.

PRO feature

AffiliateWP is a Zapify PRO integration, so this automation needs an active Zapify PRO licence.

No Connection needed for AffiliateWP

AffiliateWP runs on your own site, so there is no API key to paste for it and nothing to set up under Settings → Connections.

Before you start

  • AffiliateWP installed and active.
  • A working mail setup so WordPress can send email.

How to build the automation

Step 1: 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 Confirm approved commissions.

Create a new automation

Step 2: Add the "An affiliate's referral changes status" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose AffiliateWP as the app.

Select AffiliateWP as the trigger

  1. Select An affiliate's referral changes status.

Select An affiliate's referral changes status

  1. Configure the trigger:
Field Required What it does
Referral type Yes Any type, or one type such as Sale.
New status Yes The status that should start the automation: Pending, Unpaid, Paid or Rejected.

Set New status to Unpaid. Leave Referral type on Any type, or pick Sale.

Step 3: Add the "Send an email" action

  1. Click Add Action.

Add an action

  1. Choose WordPress as the app.

Select WordPress as the action

  1. Select Send an email.

Select Send an email

Step 4: Configure the action

Field Required What it does
To Yes Recipient address. Comma-separate several, or insert a token.
Subject Yes The subject line.
Format Yes HTML (default) or Plain text.
Body Yes The message. Insert tokens with the {} button.
Cc / Bcc No Extra recipients.
From name / From email No Override the sender.
Reply to No Set where replies go.

For example:

  • To: the User email token
  • Subject: Your commission of {Referral amount} is confirmed
  • Body: Hi {First name}, the order behind your referral is complete, so your commission is confirmed. You have {Affiliate unpaid earnings} waiting for the next payout.

Complete the Send an email action

Step 5: 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 6: Test it

Complete the order behind a test referral so it moves from Pending to Unpaid. Open Zapify → Logs to confirm the run and read what the action reported.

Tokens you can use

The trigger offers the affiliate's details, the referral's details, one extra token for the old status, and the user tokens.

Token What it holds
Affiliate ID The affiliate's numeric ID in AffiliateWP.
Affiliate status Their status: active, inactive, pending or rejected.
Affiliate referral URL Their personal referral link, ready to put in an email.
Affiliate payment email The address they get paid at.
Affiliate rate / Affiliate rate type Their commission rate and whether it is a percentage or a flat amount.
Affiliate earnings / Affiliate unpaid earnings What they have earned in total, and what is still waiting to be paid.
Referral ID The referral's numeric ID.
Referral amount The commission earned.
Referral type / Referral status Sale, opt-in or lead, and the status it has now.
Referral context The source of the referral, such as woocommerce or edd.
Referral reference (order ID) The order or record the referral was earned from.
Referral description The description AffiliateWP saved with it.
Referral products The products on the referral, as a readable list.
Referred customer email The customer's email, when AffiliateWP recorded one.
Referral previous status The status the referral had before the change.
User ID / Username / User email The user the automation runs for: the affiliate, or the referred customer when Run for is set to the customer.
Display name / First name / Last name Their name details.

Conclusion

With the An affiliate's referral changes status trigger on Unpaid and the Send an email action, affiliates know exactly when a commission is theirs. To follow up at payout time, see emailing when a referral is paid.

FAQs

Is this free in Zapify?

The Send an email action is free, but the AffiliateWP trigger is part of the AffiliateWP PRO integration and needs an active Zapify PRO licence.

What does Unpaid mean in AffiliateWP?

It means the referral is approved and has not been paid out yet.

Will it run twice if the status is set again?

No. Setting the status a referral already has is not a change, so it does not start the automation again.

Do I need to write any code?

No. Everything is configured visually in the Zapify builder.

Was this page helpful?