Quick Overview
This webhook-based workflow validates form submissions with Google reCAPTCHA, creates or updates a contact in HubSpot, checks for an existing open ticket, and either creates a new HubSpot ticket or flags it as a duplicate, then emails support and returns an HTML response to the requester.
How it works
- Receives a POST request via a webhook containing the customer and complaint details.
- Verifies the request using Google reCAPTCHA and stops processing if the verification fails.
- Creates or updates the contact in HubSpot and retrieves any tickets associated with that contact.
- Looks up the pipeline stage of associated tickets and detects whether an open ticket already exists.
- If an open ticket exists, emails the support team with the duplicate details and returns an “already logged” HTML response.
- If no open ticket exists, creates a new HubSpot ticket, patches the ticket to set the city property, and returns a “ticket submitted” HTML response.
- After returning the webhook response for a new ticket, sends a confirmation email to the customer and a detailed notification email to the support team via Gmail.
Setup
- Add a HubSpot App Private Token credential and ensure the configured ticket pipeline ID, stage ID, and ticket owner ID match your HubSpot account.
- Replace the reCAPTCHA secret in the Google reCAPTCHA request and ensure your form sends the g-recaptcha-response field to the webhook.
- Configure the webhook URL in your form or source system to POST to /hubspot-ticket-webhook with the expected fields (email, first_name, last_name, phone, city, remarks, order_no).
- Set up Gmail credentials for the customer and CS team emails, and update sender/recipient addresses (for example, [email protected] and [email protected]).
- Update placeholder values in the HTML/email content (YOUR_HUBSPOT_PORTAL_ID, example.com tracking URL, and YOUR_SUPPORT_PHONE) to match your environment.