Skip to content

JuliaKalder/TemplateWing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TemplateWing

An easy-to-use template management add-on for Mozilla Thunderbird (128+).

Available on Thunderbird Add-ons

Save and reuse email templates — including file attachments — directly from the compose window.

Screenshots

Template selection Context menu
Template selection Context menu
Manage templates Template editor
Options page Template editor

Features

  • Rich text editor — Create templates with bold, italic, underline, lists, headings, and quotes
  • File attachments — Attach files to templates; they are stored with the template and added automatically when inserting
  • One-click insert — Insert templates via the toolbar button in the compose window or the right-click context menu
  • Subject, recipients & insertion mode — Set a default subject, To/Cc/Bcc addresses, and choose whether the template appends to or replaces the current message body
  • Categories — Organise templates into categories and filter by them in both the popup and the options page
  • Variables — Use {DATE}, {TIME}, {DATETIME}, {YEAR}, {WEEKDAY}, {SENDER_NAME}, {SENDER_EMAIL}, {ACCOUNT_NAME}, {ACCOUNT_EMAIL}, {RECIPIENT_NAME}, {RECIPIENT_FIRSTNAME}, {RECIPIENT_EMAIL}, {REPLY_QUOTE}, and {LAST_MESSAGE_SUBJECT} in subject or body; they are resolved on insert. Click a variable chip in the editor to insert it at the cursor
  • Conditional content{IF lhs=="value"}…{ELSE}…{ENDIF} blocks let templates branch on recipient.domain, recipient.firstname, identity.email, etc. Nesting is supported; unknown variables compare as the empty string
  • Ask-on-insert prompts{PROMPT:Label:default} and {CHOICE:Label:opt1|opt2|opt3} open a small dialog at insert time and substitute the user's answer
  • Favorites / pinning — Click the ★ on any template to keep it pinned to the top of the popup, regardless of recent-use sort
  • Popup search — Autofocused search box filters templates instantly across name, subject, and category; Enter inserts the top match, Esc clears
  • Default template per account — In the options page, pick a template to auto-insert whenever you open a new compose window with a given account (replies and forwards are skipped)
  • Per-row import preview — Importing a JSON file now opens a preview table where every incoming template gets its own action (Skip / Add as copy / Replace existing / Edit name); bulk-action buttons cover the common cases
  • Usage dashboard — New "Usage" tab with a sortable table, a top-10 inline SVG bar chart, "unused since 30/90/365 days / never" filter, and RFC-4180 CSV export
  • Template linter — Inline badges flag unknown variables, broken nested-template references, cycles, oversize attachments, and invalid recipients; a one-line summary at the top of the list tells you whether everything is clean
  • Keyboard shortcuts — Insert your first 9 templates with Ctrl+Shift+1Ctrl+Shift+9 directly from the compose window
  • Recent templates first — The popup sorts by most recently used, so your go-to templates are always at the top; the options page shows a usage count per template
  • Import / Export with merge modes — Back up all templates as a JSON file and restore or share them on any device. On import, choose to add all, skip duplicates, or update existing by name, with a pre-import validation summary
  • Recipient validation — To, Cc, and Bcc fields are validated on save so typos are caught before insertion
  • Paste sanitization — Toggle "Paste as plain text" in the editor toolbar to strip formatting from pasted content
  • Duplicate name check — Prevents saving a template with the same name as an existing one
  • Attachment guardrails — Large-file warnings per attachment and total size indicator; per-file error handling during insertion
  • Storage schema versioning — Automatic data migration keeps templates intact across add-on updates
  • Save from email — Right-click any message in the message list → Save as Template to create a template pre-filled with subject and body
  • Dark mode — Follows the system colour scheme automatically
  • Localized — Full English and German localization; community translations for French, Spanish, Italian, Portuguese, and Dutch

Installation

From Thunderbird Add-ons (ATN)

  1. Visit the TemplateWing page on Thunderbird Add-ons
  2. Click Add to Thunderbird

Manual installation

  1. Download the latest .xpi file from the Releases page
  2. In Thunderbird: Menu (≡) → Add-ons and Themes (Ctrl+Shift+A)
  3. Gear icon (⚙) → Install Add-on From File… → select the .xpi file

Usage

  1. Open a new compose window
  2. Click the TemplateWing icon in the toolbar to see your templates
  3. Click Insert to apply a template — or use Ctrl+Shift+19 for the first nine
  4. Click Manage Templates… to create, edit, or delete templates

Templates can also be inserted via the right-click context menu in the compose body.

To create a template from an existing email, right-click a message in the message list and choose Save as Template.

Development

Load as temporary add-on

  1. Open Thunderbird → Menu (≡) → Add-ons and Themes (Ctrl+Shift+A)
  2. Gear icon (⚙) → Debug Add-ons
  3. Load Temporary Add-on… → select manifest.json
  4. Click Inspect next to the add-on for console/debugging

Reload after changes by clicking Reload on the Debug Add-ons page (no restart needed).

Build XPI

Portable Node-based builder (works on macOS, Linux, Windows; same file list as CI):

npm run build:xpi

This creates templatewing-<version>.xpi in the parent directory and prints the SHA-256.

Tags pushed to GitHub are built and released automatically by .github/workflows/release.yml.

The legacy PowerShell script build-xpi.ps1 now just delegates to the Node builder and is kept only for backwards compatibility.

Project structure

manifest.json               — Extension manifest (Manifest V2)
background.html             — Background page (loads background.js)
background.js               — Context menu, storage listeners
modules/template-store.js   — CRUD operations over storage.local
modules/template-insert.js  — Variable replacement, nested templates, insertion
modules/validation.js       — Recipient/import validation helpers
popup/popup.html|css|js     — Compose-action popup (template list & insert)
options/options.html|css|js  — Options page (template editor)
images/                     — Extension icons (SVG source + 16/32/64/128 PNG)
_locales/{en,de,fr,es,it,pt,nl}/ — Localization strings
tests/                      — Unit tests (Node.js built-in test runner)

No build step, no bundler, no external dependencies — just vanilla ES6 modules.

Privacy

TemplateWing stores all data locally on your device using Thunderbird's built-in storage API. No data is collected, transmitted to external servers, or shared with third parties.

License

Mozilla Public License 2.0

Contributing

Found a bug or have an idea? Open an issue — constructive feedback is always welcome!