Pin the quote letter's dotted templateKey, as the HR family already is

Testkamo-shared-library
Shipped
September 2, 2026 at 3:19 PM UTC
Author
Kamo
Commit
77bcf03

The constant is not the templateKey. CanonicalTemplateLoader.load derives only the FILENAME from the constant (QUOTE_SENT -> quote-sent.json) and reads templateKey out of the JSON — commerce.quote_sent. EmailTemplateService.sendToUser looks the org's row up by the key the CALLER passed and, on a miss, seeds (writing the JSON's key) and retries the SAME caller key, so a sender that passes the constant 404s forever against a row that seeded perfectly. That is what SecurityService's QuoteEmailClient did, and the database says so: 37 orgs carry a commerce.quote_sent row and none has ever carried QUOTE_SENT. The symptom was a swallowed boolean — the link minted, the panel said "Link created", no email was ever sent. QuoteSentTemplateTest pins the JSON leg of the triple the way HrPackageTemplateTest pins the HR one, plus the reverse regression: "tidying" the JSON to match the constant would restore the bug, not fix it. HrPackageTemplateTest's doc comment said this was "live today"; it no longer is.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing