update-email-templates

Updates Authgear email templates through source edits, translation regeneration, and staged commits.

2.0k|126|Updated Jun 16, 2020
One-click install
npx skills add https://github.com/authgear/authgear-server --skill update-email-templates
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-email-templates
Source: https://github.com/authgear/authgear-server/tree/main/.claude/skills/update-email-templates
Command: npx skills add https://github.com/authgear/authgear-server --skill update-email-templates

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Editing Authgear email templates incorrectly—such as modifying generated files directly or mixing source edits with generated artifacts in one commit—breaks the translation pipeline and produces inconsistent email output. This Skill enforces the correct file targets, generation commands, and commit order.

Core Features & Use Cases

  • Source-only editing rules: Restricts changes to *.txt.gotemplate and *.mjml.gotemplate files plus English translation JSON, never touching generated .txt, .mjml, or non-English locale files directly.
  • Guided generation workflow: Runs the MJML generator, deletes stale non-English translation keys, regenerates translations via Claude, and builds final HTML emails with make targets.
  • Strict commit boundaries: Separates source edits, regenerated translations, and HTML artifacts into three distinct commits.
  • Use Case: When changing the wording of a password-reset email subject line, follow this workflow to edit the English source template, regenerate MJML and translations, and produce clean, reviewable commits.

Quick Start

Update the welcome email body text in Authgear following the email template workflow and commit the changes correctly.

Frequently Asked Questions about update-email-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update Authgear email templates correctly?

Edit only the source files under resources/authgear/templates/en/messages, specifically *.txt.gotemplate and *.mjml.gotemplate plus the English translation.json files. Then run the MJML generator, regenerate translations, and build HTML emails in separate commits.

How to change an email subject line in Authgear?

Email subject translations live in resources/authgear/templates/en/translation.json. Edit the key there, then delete the same key from all non-en translation.json files using make translation-json-del-key before regenerating translations.

Can I edit generated .mjml or .txt email files directly?

No, generated .mjml and .txt files must never be edited directly. Always modify the corresponding .gotemplate source files and regenerate outputs with go run ./scripts/generatemjml/main.go and make html-email.

Why must non-English translation keys be deleted before regenerating?

The translation generator only recreates keys that are missing, so stale non-English keys must be deleted first using make templates-translation-json-del-key or make translation-json-del-key. This forces regeneration of updated content in every locale.

What happens if translation generation fails with a login error?

The translation step requires an active Claude session via claude login. If generation fails due to authentication, stop the workflow and ask the user to run claude login before retrying make -C scripts/python generate-translations.