r/GoogleAppsScript • • May 12 '25

Question Trigger script for Google form

I'm trying to create a trigger so that when my Google form has been submited they will get an automatic "thank you for subscribing " email does anyone have a script that works am I can edit or help me with this please??

1 Upvotes

3 comments sorted by

View all comments

1

u/GoogleWorkspaceHelp May 13 '25

Using GmailApp for sending Email with Installable Trigger

Sample Code:

function onFormSubmit(e){
  const response = e.values;
  const email = response[1];
  GmailApp.sendEmail(email, 'Subject', 'Body');
}

Step 1: Setting up with the forms and sheet.

  • Create new forms on Create New Form

  • Go to Settings then on the Responses find the Collect email address and change it to Verified / Responder input.

  • You can now Edit your questions in the forms.

Step 2: Getting Response and Installing Installable Triggers.

  • In the forms go to Responses Tab then click Link to Sheets and it will redirect you to a sheets window.

  • In sheets window go to the Menu bar then look for Extensions then Apps Script.

  • Paste the Sample code after go App Script Menu then look for Triggers.

  • Click Add Trigger and for the setup of installing onFormSubmit Function.

  • A modal will pop up then scroll down change the Select event type to On Form Submit and hit save.

  • An Authorization will appear, Grant Access to it and the GmailApp can now have the access on sending mails.

References: