We’re in need of a way to target an email marketing campaign to contacts whenever a new company offering our product opens in their area. The contact information is accumulated in the HubSpot Contacts object and the data we collect for a contact is pretty basic (name, postal code, email address). The HubSpot Companies object will contain the list of offering our product which will updated from our ERP using a PieSync integration. When a new company offering our product is identified by the workflow, then we want to send an email to all contacts within a designated radius of the new company to inform the contact of the new availability. Using a HubSpot workflow we want to detect the new company offering our product, filter the contact list to those within a specified distance from the company, and send the email. I’ve searched the Knowledge Base and Community and found this article which most closely resembles what we need, using geo_distance: HubDB - HubSpot docs But, none of the examples use a workflow. Is what we need even possible with Enterprise?
@Josh , @Bryantworks do you all have thoughts here?
Hey @CBludau,
I believe with the new Ops Hub and it’s code feature you could theoretically do this, but to be honest I haven’t really dove in head first with that new action just yet.
Update: Using Operations Hub I’ve utilized a workflow containing custom code to detect a new company, calculate the distance between the new company and all our marketing contacts who’ve opted to receive updates, update contact properties to contain company information, programmatically create an active list to contain the contacts in proximity to the company, programmatically create a workflow to monitor enrollment in the active list to send emails to contacts added to the list. I created several custom properties on Contacts and Companies to contain data needed for the workflows. Since we are limited to knowing only the zip code of a contact, I created HubDB tables to contain the latitude and longitude of zip codes in the United States, which are then used for the proximity calculation. So, this one workflow spawns another workflow and creates an active list for each new company, which if you have many companies can get a little messy. I could not find a way to programmatically move the workflow and active list to a folder, so I manually move the new workflows and list to a folder, for now. But, overall the workflow does serve our purpose until we have the feature built-in to HubSpot.
Kudos @CBludau! That sounds like you knocked it out of the park!