How to Trigger a Mass Email to Filtered Contacts from a Webhook with a Custom Object in HubSpot Work
SOLVE
Good morning,
Let me give you some context and try to explain in as much detail as possible the use case we need to cover. Please, we would appreciate a response with the most concrete solution possible, as we’ve been trying different alternatives for several days without success 😟
The idea is to receive a webhook containing a custom object called "New Offer" with data similar to:
{offer: {name: "New offer", price: 99}}
This object does not share any properties with any contact, as it’s a completely separate general entity unrelated to contacts.
When we receive this webhook, we would like to send a mass email to contacts who have specific values in their properties:
Subscription → Basic
IWantByNotified → Yes
To achieve this, we’ve considered either filtering those contacts at the time of sending the email or creating a dynamic active list that only includes those users.
The problem arises when we consider that there could be many users (in the thousands), and we’re limited by API call constraints.
Our first idea was to create two workflows:
One that receives the webhook and updates the contact properties. However, since the trigger is based on a custom object, we would need to update the contacts via a custom code action, which has its limitations (execution time cannot exceed 20 seconds, API calls are limited, pagination needs to be handled, etc.). This approach likely won’t scale well if we have many users in the future and could eventually fail.
Another one triggered by a modification to a contact’s property, which then sends the email.
We believe this is a relatively common use case, but we haven't been able to find a working solution. That’s why we would need a concrete approach to help us implement it.
Ideally, workflows would allow us to directly use the webhook data to send emails to the contacts in a list, but we believe this isn’t possible. Maybe there’s another way to do it (with campaigns or something similar), but we haven’t found anything viable within workflows.
They suggest trying a Smart List combined with a Static List as a possible workaround. They haven’t tested this exact method before, but they believe it could be the most effective solution for your situation.
Create an active list with your filter (subscription + notify).
Use a scheduled workflow that enrolls contacts in that list.
Then use that workflow to send the email directly (no update needed).
You can use a delay to schedule it shortly after the "New Offer" event.
Pros: No custom code, no rate limit issues. Limitation: Can't dynamically pass offer data into email unless it's a global offer (not personalized).
How to Trigger a Mass Email to Filtered Contacts from a Webhook with a Custom Object in HubSpot Work
SOLVE
Thank you for your response. My question is: If there are thousands of matching contacts, in the custom code action I would have to call the corresponding API endpoint to filter the contacts, paginate through them, and update them — potentially hitting HubSpot's API rate limits, right? Is there no way to update all the contacts at once?
How to Trigger a Mass Email to Filtered Contacts from a Webhook with a Custom Object in HubSpot Work
SOLVE
Oh, I see what you mean! 😑
You can move the logic to your server or cloud function instead of a HubSpot custom code action. But you still need to obey rate limits, but you have more control.
They suggest trying a Smart List combined with a Static List as a possible workaround. They haven’t tested this exact method before, but they believe it could be the most effective solution for your situation.
Create an active list with your filter (subscription + notify).
Use a scheduled workflow that enrolls contacts in that list.
Then use that workflow to send the email directly (no update needed).
You can use a delay to schedule it shortly after the "New Offer" event.
Pros: No custom code, no rate limit issues. Limitation: Can't dynamically pass offer data into email unless it's a global offer (not personalized).