Introduction
When you use Google Forms to gather information, a quick thank‑you or welcome email can turn a simple submission into a professional interaction. Automating that message saves time, improves respondent experience, and even lets you share resources such as PDFs or spreadsheets stored in Google Drive. In this tutorial we will walk through every step required to send a personalised welcome email the moment someone completes your form. You will learn how to collect the respondent’s address, write a small Apps Script that composes the email, attach files from Drive, and set up a trigger that fires automatically. By the end of the guide you will have a fully‑functional, hands‑free notification system ready for any survey, registration, or quiz.
Collect Email Addresses Directly in the Form
Before any automation can occur, the form must capture a valid email address. Open your Google Form, click the Settings gear, and enable Collect email addresses. If you prefer a custom field, add a short‑answer question titled “Email” and mark it as required. This ensures every response includes a reliable response.getRespondentEmail() value that the script will later use as the recipient address.
Write the Apps Script that Sends the Welcome Message
1. From the Form editor, choose Extensions → Apps Script.
2. In the script editor, replace the default function with the following skeleton:
- function onFormSubmit(e) {
- var email = e.response.getRespondentEmail();
- var subject = “Welcome to [Your Project]!”
- var body = “Hi ” + e.response.getRespondentEmail() + “,\n\nThank you for completing our form. Please find the attached resources.”;
- // Attachment handling will be added later
- MailApp.sendEmail(email, subject, body);
- }
This function receives the event object e, extracts the respondent’s email, builds a subject line and body, and finally dispatches the message through MailApp.sendEmail(). Save the project with a clear name such as “FormWelcomeMailer”.
Attach Files from Google Drive to the Email
To include PDFs, guides, or spreadsheets, locate their Drive IDs (the string after /d/ in the file URL). Extend the script as follows:
- var fileId = “YOUR_FILE_ID”;
- var file = DriveApp.getFileById(fileId);
- var attachment = file.getBlob();
- MailApp.sendEmail({
- to: email,
- subject: subject,
- body: body,
- attachments: [attachment]
- });
If you need multiple files, create an array of blobs and pass it to the attachments property. Remember that the script runs under your Google account, so the files must be shared with you (owner or editor) to be accessible.
Set Up an Installable Trigger and Test the Workflow
Simple triggers cannot call MailApp, so you must create an installable “On form submit” trigger:
- In the Apps Script editor, click the Triggers (clock) icon.
- Select Add Trigger, choose
onFormSubmitas the function, set the event type to From form → On form submit, and save. - Authorize the script when prompted; this grants permission to send email and read Drive files.
Submit a test entry through the live form, then check the recipient inbox. Verify that the subject, body, and attachment appear exactly as intended. If the email lands in spam, adjust the content or add a custom “From” name to improve deliverability.
Personalisation Tips and Common Troubleshooting
To make the message feel more tailored, pull additional answers from the response object, e.g., the respondent’s first name, and insert them into the body with string concatenation. Use HTML formatting by passing htmlBody instead of plain body if you need bold or linked text.
Common issues:
- Missing email address – ensure the form actually collects it; otherwise
e.response.getRespondentEmail()returnsnull. - Attachment size limit – Gmail caps attachments at 25 MB; split large resources into multiple emails or provide a Drive sharing link instead.
- Trigger not firing – verify that the trigger is installed under the same account that owns the script and that the script has the required permissions.
By iterating on these details, you can create a polished, automated welcome system that scales with any volume of form responses.
Conclusion
Automating a welcome email for Google Form respondents is a straightforward process that combines three core steps: capturing the email address, scripting the message (with optional Drive attachments), and attaching an installable trigger. Once the Apps Script is in place, every new submission instantly receives a personalized note and any supporting files you choose to share. This not only saves countless manual minutes but also reinforces a professional brand image and improves engagement. With the personalisation tips and troubleshooting guidance provided, you can adapt the solution to a wide range of use‑cases—from event registrations to customer onboarding—ensuring a smooth, reliable communication flow without lifting a finger after the initial setup.









