A web API to facilitate automations and services relevant to our organization including adding emails to the mailing list, sending emails, and reading calendar events. Co-authored with Eeshaan Pirani.
cp .env.example .env
- Create a new project in the Google Cloud Console.
- Enable the Admin SDK API, the Google Spreadsheets API, and other APIs as needed.
- Create a new service account and export the JSON credentials.
- A valid JSON will have
"type": "service_account"
as the first key-value pair.
- A valid JSON will have
- Set the environment variable
GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON.
Note: API calls can only be made if the "subject" field in the body is set to an admin of the Google Workspace. Set
GOOGLE_WORKSPACE_ADMIN_ACCOUNT
to the email address of an admin in your workspace.
Set the environment variables SMTP_HOST
, SMTP_USER
, and SMTP_PASS
. By default, the application uses port 465 for secure transfer. It can be changed in processes/confirmationEmail.process.ts
if needed.
- Set the environment variable
SPREADSHEET_ID
to the ID of the Google Spreadsheet you'd like to append to. - Set the environment variable
GROUP_ID
to the ID of the Google Group you'd like to add members to.
docker-compose build
docker-compose up
npm i
npm i -g pm2
npm run build && pm2 start