Attach the invoice PDF to the payment-method-switched email, brand-tone copy
buildInvoiceAttachment() extracted out of sendOrderConfirmationEmail() so sendPaymentSwitchedEmail() can reuse the same invoice-PDF generation instead of duplicating it — the invoiceNumber stays the same, but paymentMethodTitle now reflects the confirmed instrument, which flips the PDF's own paid/unpaid display, so re-attaching a fresh copy matters here even though nothing else about the order changed. Default fallback copy replaced with brand-toned wording matching the existing order-confirmation fallback's voice, instead of a flat system-notice tone.
This commit is contained in:
@@ -33,7 +33,7 @@ export async function sendConfirmedPaymentEmail(order: ConfirmPaymentOrderSnapsh
|
||||
const { customerEmail, ...emailData } = order;
|
||||
try {
|
||||
if (order.paymentSwitchedAt) {
|
||||
await sendPaymentSwitchedEmail(order.orderNumber, customerEmail);
|
||||
await sendPaymentSwitchedEmail(emailData, customerEmail);
|
||||
} else {
|
||||
await sendOrderConfirmationEmail(emailData, customerEmail);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user