Webhook for contact opting out of email?

New Member

Currently I'm testing the HubSpot API for an integration I'm going to build. For this I would like to subscribe to a webhook, which notifies me when an user opted out of receiving emails.

 

While the API returns 'hs_email_optout', which indicates the user is opted out, it cannot be selected when creating a webhook for an app when selecting Contact -> Property changed.

 

How could I go about this? I'm trying to achieve a similar thing as with MailChimp, with where I'm able to create a webhook, which notifies me whenever a contact unsubscribes from a list.

Reply
0 Upvotes
1 Reply 1
Highlighted
HubSpot Moderator

Hi @jelledv 

 

When a contact opts out of an email subscription type or opts out from all emails, the subscribed value will be false; we can use the webhook subscription to listen to updated contact property events. 

 

Note: While the standard properties only include hs_email_optout which means if a contact opt out of all email, this property will change and if you're looking to receive subscription status for an individual email type and if your team is either professional/enterprise subscription, we can use a workflow to set up something like this:

  • Set the enrollment trigger to "Contact has opted out of all of e.g. email subscription type A"
  • Set a custom contact property to TRUE

Having the custom property update in the workflow, we can use it to create the webhook subscription and listen to update on those custom properties.

 

I hope this helps!

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes