Google Apps Script: SpreadsheetApp, Utilities, MailApp, UrlFetchApp, HtmlService, onOpen
Ever wanted a quick way to send reminders to staff, letting them know that their task is overdue?
I often have to provide Google Sheet checklists that administration team managers can crosscheck to see if their team members have complete a certain task.
Reminding staff to complete a task can be time consuming and irritating. What if you could send an email to all those staff members who haven’t completed the task with a simple click of the button?
In this tutorial, we will learn how to create a Google Apps Script HTML email mail merge service that will send an email to a staff member who has not completed their task, indicated by a missing tick on a tickbox.
We will use the sample sheet below:
The Google Sheets reminder is triggered by a custom menu item. You can see it at the top right of the image.
When the reminder is sent, it collects the rows of staff that have not indicated that they have completed the task. It then sends an email to those staff members with the reminder below:
As you can see, I’ve added some custom HTML to highlight the header and modify the width of the image. The email contains a number of unique pieces of data gathered from the Google Sheet Row:
- The name of the user.
- The deadline.
- The name of the sheet (In this case, Tester).
- The number of days overdue.
It also contains a link to the check sheet for the user to update once they have completed their task.
Back at The Badger Google Sheet, an alert window appears once the code is completed and also indicates any emails that could not be sent.
To get started you can Make a Copy of the Google Sheet by following this link:
Continue reading “Google Apps Script: Create an HTML email reminder service from Google Sheet data.”