- This code snippet in this article requires the latest version 1.4+ of WP Zapier
- A free account (or higher) on Zapier.com
- Follow this guide to setup WP Zapier to receive data from Zapier (You may use the update_user action)
- MailPoet (V3)
Setting Up The Data For Zapier To Insert Into MailPoet
In this example, we will use the update_user action which is a default function of the WP Zapier plugin. This will allow you to update WordPress users if you pass new data (if you don’t want to update the user you only need to pass through the user’s email as per the image below) and with the code snippet you will be able to add user’s to a MailPoet list(s).
The code snippet will create a MailPoet subscriber and add them to the specified lists that is passed through. Let’s get to the data you need to add subscribers to MailPoet. When you map the data inside Zapier, you will add a variable with a comma separated value for the multiple MailPoet list ID’s you want to add your users to. This can be dynamically added inside your trigger application (i.e. Google Sheets).
Tip: How To Get MailPoet List ID
To get a MailPoet list ID navigate to MailPoet and select Lists. Here you will see the lists you’ve created within MailPoet. You may click the edit button and in the URL of the edit screen you will see the list’s ID.
You may use the ‘wp_zapier_custom_webhook’ as of version 2.0 of WP Zapier if you don’t want to run the update user function.