Skip to content

fix(invoices): correct payment-check email template key so dunning email sends#752

Open
Luca-Timo wants to merge 1 commit into
PicPeak:mainfrom
Luca-Timo:fix/dunning-payment-check-template-key
Open

fix(invoices): correct payment-check email template key so dunning email sends#752
Luca-Timo wants to merge 1 commit into
PicPeak:mainfrom
Luca-Timo:fix/dunning-payment-check-template-key

Conversation

@Luca-Timo

Copy link
Copy Markdown
Collaborator

Fixes #751.

queuePaymentCheckEmail queued the admin payment-check email with template key invoice_payment_check_admin (invoiceService.js:3059), but no such template exists — the only one is invoice_payment_check (crmEmailTemplates.js:217, seeded by migration 116), which IS the admin "Paid / Partial / Not paid" email. The processor does an exact template_key lookup (emailProcessor.js:715) and throws Email template '…' not found, so every dunning admin payment-check email fails, retries to the cap, and gets stuck pending.

One-word fix: queue invoice_payment_check. Unbreaks the built-in invoice-dunning flow's email step. Verified in the field: the queued row's error_message was exactly Email template 'invoice_payment_check_admin' not found.

Left as a follow-up (cosmetic, not a break): the dev-tools test-send list still references invoice_payment_check_admin — that surface already greys out absent templates.

…ail sends

queuePaymentCheckEmail queued the admin payment-check email with template
key 'invoice_payment_check_admin', but no such template exists — the only
one is 'invoice_payment_check' (crmEmailTemplates.js:217, seeded by
migration 116), which IS the admin "Paid / Partial / Not paid" email. The
processor does an exact template_key lookup and throws "template not
found", so every dunning admin payment-check email failed, retried to the
cap, and got stuck pending.

One-word fix: queue 'invoice_payment_check'. Unbreaks the built-in
invoice-dunning flow's email step. (Rebased onto the post-decompose
invoiceService refactor — the line now lives in invoice/payments.js.)
@Luca-Timo Luca-Timo force-pushed the fix/dunning-payment-check-template-key branch from 818b453 to 3682de1 Compare July 4, 2026 21:51
@Luca-Timo Luca-Timo enabled auto-merge July 4, 2026 21:54
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.

[BUG] Dunning payment-check admin email never sends — wrong template key (invoice_payment_check_admin)

1 participant