Skip to main content

Zapier Integration

Divi Membership's Zapier integration enables users to automate workflows by connecting subscription data with hundreds of apps via Zapier webhooks. This feature triggers actions in other apps when new subscriptions are created, cancelled, or refunded in Divi Membership.

Setting Up Webhooks for Subscription Events

Webhooks for the following subscription events can be configured:

  • Subscription Created
  • Subscription Cancelled
  • Subscription Refunded

How to Add Webhook URLs

Follow these steps to configure your webhooks:

  1. Go to the Integrations tab in your Divi Membership settings.
  2. Find the Zapier section.
  3. Input your Zapier-provided webhook URLs into the corresponding fields for each subscription action.
  4. Click Save Changes to enable the webhooks.

Modifying Data Sent to Zapier

You can modify the data payload sent to Zapier using the following filters:

  • dmem_zapier_created_subscription_data
  • dmem_zapier_cancelled_subscription_data
  • dmem_zapier_refunded_subscription_data

These filters allow alterations to the $data and $subscription_id parameters.

Code Example

Here's how to modify the data for a created subscription:

// Modify subscription data before sending to Zapier
function modify_created_subscription_data($data, $subscription_id) {
// Add a custom data field
$data['custom_field'] = 'Custom Value';
// Change existing data field
$data['subscription_status'] = 'active';
// Return modified data
return $data;
}

// Hook the above function to the filter
add_filter('dmem_zapier_created_subscription_data', 'modify_created_subscription_data', 10, 2);

Replace dmem_zapier_created_subscription_data with the relevant filter for the subscription event you are targeting.