The Brevo and Omnisend integrations add each customer’s referral code to their contact. You can then use it to build their referral link in your emails and automations.
Brevo
1. Add the contact attributes
- In Brevo, go to Contacts → Settings → Contact attributes.
- Add a Text attribute named
REFERRAL_CODE. - Add a Date attribute named
REFERRAL_CREATED_DATE.
2. Connect the plugin
- In Brevo, go to SMTP & API → API keys and create a key.
- In WordPress, go to WooCommerce → Refer a Friend → Integrations.
- Under Brevo, turn on Enable Integration, paste the key into Brevo API Key, and click Save Settings.
- To send codes your customers already have, go to WooCommerce → Status → Tools and click Sync to integrations.
The plugin creates or updates the contact with REFERRAL_CODE, REFERRAL_CREATED_DATE, FIRSTNAME and LASTNAME. It doesn’t add contacts to a list. Use your own lists and consent forms to decide who receives marketing.
In emails, use {{ contact.REFERRAL_CODE }}, for example in a link to https://yourstore.com/?raf={{ contact.REFERRAL_CODE }}.
Omnisend
Omnisend contacts are set to subscribed for email. That includes customers who never agreed to marketing emails, and it may re-subscribe people who unsubscribed. If you need consent, for example under GDPR, leave the integration off and import exported codes instead. See Export referral codes.
- In Omnisend, go to Store settings → API keys and create a key with access to contacts.
- In WordPress, go to WooCommerce → Refer a Friend → Integrations.
- Under OmniSend, turn on Enable Integration, paste the key into OmniSend API Key, and click Save Settings.
- To send codes your customers already have, go to WooCommerce → Status → Tools and click Sync to integrations.
The plugin adds two custom properties to the contact: referralCode and referralCreatedDate. Use referralCode in your email content, for example in a link to https://yourstore.com/?raf= followed by the code.
Check it worked
Create a test customer account, then find that email in your Brevo or Omnisend contacts. It should have the referral code. If not, check the API key and the attribute names. Errors are written to your PHP error log, starting with “Brevo API Error” or “OmniSend”.