Automates email notifications to district social workers when a referral form is submitted and indicates that a related service counselor is involved in the case.
- Sends email notifications to designated recipients when a referral form is submitted.
- Checks the submission to determine whether a related service counselor is involved.
- A Google Apps Script trigger fires when a new row is added to the linked Google Sheet (via form submission).
- The script reads the last row and checks column Y for a related service counselor's name.
- If the value is not
N/A, an email is sent to the recipients defined in Script Properties.
Code.js— Main script containing the email notification logic.appsscript.json— Project manifest for Google Apps Script..clasp.json— Local clasp configuration (ignored by git; each developer sets their own).NISD_Social_Services_Referral_Form.pdf— Example of the Google Form used with this script. Use this as a reference when building your own form.
- Node.js and clasp installed (
npm install -g @google/clasp) - A Google account with access to the target Apps Script project
- A Google Form and linked Sheet structured like the example in
NISD_Social_Services_Referral_Form.pdf, where:- Column B contains the submitter's name
- Column Y contains the related service counselor's name (or
N/A)
-
Clone this repository.
-
Log in to clasp:
clasp login -
Update
.clasp.jsonwith your ownscriptId(found in the Apps Script project under Project Settings). -
Push the code:
clasp push -
In the Apps Script editor, go to Project Settings → Script Properties and add the following:
Property Value EMAIL_RECIPIENTSComma-separated list of recipient email addresses REFERRAL_FORM_LINKFull URL to the referral Google Sheet -
Set up a trigger for
sendEmailto run On form submit: Triggers → Add Trigger →sendEmail→ From spreadsheet → On form submit.
Originally created for Northside Independent School District (NISD). Adapted for general use as an open resource. See LICENSE for details.