This engine connects email templates with live data to automatically generate formatted email drafts, reducing manual effort and standardizing recurring communication.
This project originated from a common problem: duplicated scripts across multiple spreadsheets, each with hardcoded emails, links, and dates. Updating one template meant hunting down every copy. The engine solves this by separating dynamic content (templates, recipients, links) from core logic — non-technical teammates can edit templates in Google Docs and manage recipient lists in Sheets without touching code.
- Centralizes templates — Edit email content in Google Docs or Word
- Centralizes data — Recipients, links, and settings live in Sheets or Excel
- Standardizes output — Consistent formatting, no copy-paste errors
- Not for marketing emails (use Mailchimp)
- Not a SaaS product — runs in your Google Workspace or server
- Not replacing judgment — still review drafts before sending
- Not a marketplace add-on — it's your code, your control
Before:
- Open performance report Sheet
- Copy the table
- Open Gmail draft from yesterday
- Paste table (formatting breaks)
- Update the date manually
- Check if the recipient list is current
- Send
After:
- Click button in Sheet
- Review draft (already formatted, correct date, right people)
- Send
| Version | Best for | Location |
|---|---|---|
| Google Apps Script | Zero-setup, runs inside Google Sheets, no build needed | /legacy |
| Node.js + Google | Cloud Functions, CI/CD, higher quotas, unit-testable | packages/nodejs-google |
| Node.js + Microsoft 365 | Outlook / Graph API / Excel / OneDrive | packages/nodejs-microsoft |
- Open your Google Sheet → Extensions > Apps Script
- Copy all 4 files from
/legacyinto the script editor - Update the
CONFIGobject:
const CONFIG = {
templateDocumentId: "YOUR_TEMPLATE_DOC_ID",
directorySheetId: "YOUR_DIRECTORY_SHEET_ID",
linkRepositorySheetId: "YOUR_LINK_SHEET_ID",
};- Call it:
generateEmailDraft("Monthly_Report"); // creates draft
generateEmailDraft("Monthly_Report", { action: "SEND" }); // sends directly
generateEmailDraft("Monthly_Report", { testMode: true }); // sends to you onlypackages/
├── core/ # Platform-agnostic engine — no platform deps
├── nodejs-google/ # Google Workspace (Gmail API, Sheets, Docs)
└── nodejs-microsoft/ # Microsoft 365 (Graph API, Outlook, Excel)
For template syntax see TEMPLATE_SYNTAX.
MIT