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.