glenwinters / foster-plea

Apps Script to build draft plea emails from a spreadsheet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Foster Plea

A Google Apps Script to build draft plea emails from a spreadsheet.

Input (Google Sheets spreadsheet):

spreadsheet

Output (draft email in Gmail):

email

Usage

This is still in development, so the steps are a bit manual and some values need to change for the final spreadsheet.

Right now, a test spreadsheet has to have the following columns, in order:

  • Type of Animal
  • Status
  • Name
  • Age
  • Physical Description
  • Plea Notes
  • Photo
  • Feeding Notes

Push the code. You can't copy and paste because the code in this repo is in TypeScript and running clasp push transpiles it to Google Apps Script. You will likely need to allow permission for the spreadsheet and Gmail.

Then, from the spreadsheet, go to Tools -> Script Editor. Click the "Select function" dropdown and select "createNeoNatalSGDraftPleaEmail". Click the play button to the left of the function dropdown to run it.

Check your email drafts. If you had it up and don't see anything, click "Drafts" to refresh the view. You should see a new draft generated by the script.

Development

Setup

Install clasp, a cli for managing Apps Script projects locally.

npm install @google/clasp -g

Actions

Login to your Google account to create a credentials file:

clasp login

Update the remote project:

clasp push

Watch the logs:

clasp logs --simplified --watch

Links

Apps Script

Spreadsheet Service

GmailApp class

Templated HTML with HtmlService

class HtmlOutput

Clasp

Clasp guide

Clasp docs

Clasp TypeScript guide

About

Apps Script to build draft plea emails from a spreadsheet

License:MIT License


Languages

Language:TypeScript 86.2%Language:HTML 13.8%