Monday, 25 February 2019

Email scheduler for Gmail - overview

Over the next few blog posts I look to explore my development of an email scheduler for Gmail that is designed to let you schedule when you want an email composed in your drafts to be sent (by specifying the date/time).

Background
Over time there had been a number of requests of people wanting an email scheduler with nothing other than the likes of Boomerang or Gmelius suggested as alternatives. The issue with these being that you can only perform a limited amount of scheduling on the free plans before then needing to upgrade, which becomes costly for multiple people at an institution. The other issue is to do with GDPR and a third-party add-on accessing the entirety of a persons email inbox - this reason also applies to the free extensions that you can get for Chrome/Firefox.

So because of the above and the desire to continuing my learning I decided I would have a go at creating an email scheduler via a Google sheet. I will be sharing all of the code as usual and providing you with a downloadable version - which then becomes yours to run without accessing anything other than your Gmail.

Solution - Overview
The process:
Fully compose your Gmail message (To, Subject, Body, Attachments) > open the Google sheet and click to import your Gmail drafts > set a date/time and click to schedule the message.
The script will work for multiple messages at any one time and there are other actions you can perform such as: cancel schedule, delete/archive delivered.
Screenshot of columns used by email scheduler
Email scheduler spreadsheet columns
Solution - Scripts
Here is a list of the scripts that form the email scheduler, I will link them to the relevant blog posts as they are released:
  • getDraftMessages - this function gets any current draft messages in Gmail and copies their details into the spreadsheet.
  • checkDuplicateDraft - this function is designed to check if a Draft message with the same ID already exists in the spreadsheet before importing.
  • createSchedule - this function creates the trigger schedule for the message from the given date/time.
  • sendEmail - this function sends the email when the trigger runs and writes the time back
    to the spreadsheet.
  • cancelSchedule - this function cancels selected scheduled messages.
  • deleteTrigger - This function deletes a specific project trigger from a given triggerID.
  • archiveDelivered - This function archives delivered message entries and removes the expired trigger.
  • deleteRow - This function deletes the entire row of data.
  • logEvent - This function allows for user logging in the other scripts so that an action is recorded on the 'Log' sheet. I have linked to an existing blog post on this function.
Solution - Download
I will add the relevant file once all of the blog posts are complete.

No comments:

Post a Comment