This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off as you plan your implementation.
Some Wix users communicate with their subscribers through an external email marketing tool, even if they manage their subscribers in Wix. To comply with privacy regulations, Wix users need to ensure that only contacts who have opted in to marketing emails will receive those emails.
Email subscription status is conveyed in the subscriptionStatus
field.
To allow Wix users to email only opted-in contacts,
you should request subscription statuses from Wix before starting a campaign
with this basic flow:
Request the campaign recipients from the external tool. Format the emails as an array.
Request the list of subscription statuses from Wix by including the array of emails in Query Email Subscriptions:
Filter for the contacts
whose subscriptionStatus
is SUBSCRIBED
,
then extract those email addresses into an array.
Return the final, filtered array to the external email marketing tool. This is the confirmed list of contacts who have opted in to marketing emails from the Wix user, and who can now receive the email campaign.
Wix users can keep their email marketing tool updated with their Wix Contact List with a two-way sync. To synchronize Wix and an external system, think about how you will handle these flows:
Create a mapping from the Wix fields to the email marketing tool fields, to be used whenever Wix and the email marketing tool are synchronized. Store this mapping.
To avoid getting caught in an endless loop, include logic that ignores events that are triggered as the result of a sync.
Listen for any changes to Wix email subscriptions with the Email Subscription Changed event. When this event is triggered, you receive the email subscription in the payload.
Bring those updates to the email marketing tool with a flow like this:
Extract the data
field — which is stringified JSON —
and convert it to true JSON.
After JSONified, it takes this structure:
Use the mapping (from the initial setup)
to copy the email
and subscriptionStatus
to the email marketing tool.
Ignore the resulting event from the email marketing tool so you don’t create an endless loop of updates.
Listen for any changes to email subscriptions from the external CRM. Synchronize those changes with a flow like this:
Parse the payload to extract email and subscription status.
Use the mapping (from the initial setup) to copy the email and subscription status to Wix. Call Upsert Email Subscription to send the data:
Ignore the resulting event from Wix so you don’t create an endless loop of updates.