๐ซ Handle portfolio contact form submissions with webhook, SMTP and Google Sheets
โก 38 views ยท ๐ซ Ticket Management & Triage
Description
Quick Overview
This workflow receives portfolio contact form submissions via a webhook, validates and normalizes the input, then logs the message to Google Sheets and sends a confirmation email via SMTP before returning a JSON success or error response.
How it works
- Receives a POST request on a webhook endpoint for contact form submissions.
- Validates that name, email, and message are present and within length/format limits, and returns a 400 JSON error response for invalid requests.
- Normalizes the fields (trim text, lowercase email, set defaults, add timestamp and source) for valid submissions.
- Appends the submission details to a Google Sheets spreadsheet.
- Sends a personalized HTML confirmation email to the submitter using SMTP.
- Returns a 200 JSON success response with basic submission details and CORS headers.
Setup
- Configure the webhook URL in your portfolio contact form and restrict allowed origins/CORS to your domain.
- Add a Google Sheets OAuth2 credential and set the target spreadsheet and sheet where submissions should be appended.
- Ensure the Google Sheet has columns that match the fields being written (Name, Email, Subject, Message, Phone, Timestamp, Source).
- Add an SMTP credential and set the desired from address and email template content in the confirmation email step.
๐ Nodes Used
Send Email, Google Sheets, Webhook
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File