Keep Gladly customers in sync with new HubSpot contacts

By General Input

Every time you add a contact in HubSpot, we automatically create or update their Gladly profile so support always sees up-to-date customer details.

Integrations

  • Gladly
  • HubSpot

Type

Deterministic Code

Categories

  • Customer Support
  • Operations

Whenever a new contact is created in HubSpot, keep our Gladly support system in sync by upserting that person as a Gladly customer. Trigger this on HubSpot's new-contact poll trigger so it runs automatically each time a contact is added in the CRM.

From the new HubSpot contact, read the email, first name, last name, and phone number. If the contact has no email address, stop and skip it. Email is the natural key for this sync because Gladly customer emails are unique per organization, and a contact with no email cannot be matched safely.

Look the person up in Gladly with Find Customers, searching by the contact's email. Because Gladly customer emails are unique across the org, at most one profile will match.

If no matching Gladly customer exists, create one with Create Customer, setting the customer name from the HubSpot first and last name, the email from the HubSpot email, and the phone from the HubSpot phone. If a matching customer already exists, update it with Update Customer so its name, email, and phone match the HubSpot contact.

Map the fields deterministically: combine HubSpot's first name and last name into the Gladly customer name, put the HubSpot email into the customer's email, and put the HubSpot phone into the customer's phone. This is a one-way sync from HubSpot into Gladly: only create or update, never delete a Gladly customer, and do not run this in reverse. Gladly REST reference: https://developer.gladly.com/rest/

Related prompts

Explore more prompts
Turn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRMLead response desk with a running clock on every new leadApprove Lusha enrichment field by field before HubSpot saves it