Skip to content

fix(emails): correct invoice_issued mail template key to invoiceIssued - #818

Merged
leomp12 merged 1 commit into
mainfrom
fix/invoice-issued-mail-templ
Aug 25, 2026
Merged

fix(emails): correct invoice_issued mail template key to invoiceIssued#818
leomp12 merged 1 commit into
mainfrom
fix/invoice-issued-mail-templ

Conversation

@vitorrgg

Copy link
Copy Markdown
Member

Bug

Every invoice_issued transactional email fails with:

TypeError: render is not a function
    at handleApiEvent (.../@cloudcommerce/app-emails/lib/event-to-emails.js)

@ecomplus/transactional-mails exports the invoice template as invoiceIssued (camelCase, like all the other status templates: inProduction, readyForShipping, ...), but get-mail-templ.ts returns templ: 'invoice_issued' for that status. getMailRender then resolves transactionalMails['invoice_issued']undefined, and the render call throws. The event is retried a few times and finally dropped by age, so the customer/merchant never get the invoice email.

templ is typed as plain string, which is why the wrong key type-checked.

Fix

One line: templ: 'invoice_issued'templ: 'invoiceIssued'.

Observed in production on store 401207 (mundoquadri, 2026-08-24, order #6107): all other email types reach the SMTP provider normally, only invoice_issued throws.

🤖 Generated with Claude Code

@ecomplus/transactional-mails exports the invoice template as
`invoiceIssued` (camelCase, like all other status templates), but
get-mail-templ.ts returns `templ: 'invoice_issued'`. The lookup
`transactionalMails[templateName]` then returns undefined and every
invoice_issued email fails with "TypeError: render is not a function".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leomp12
leomp12 merged commit dd472a5 into main Aug 25, 2026
3 checks passed
@leomp12
leomp12 deleted the fix/invoice-issued-mail-templ branch August 25, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants