import { Link, Section, Text } from '@react-email/components' import { baseStyles, colors } from '@/components/emails/_styles' import { EmailLayout } from '@/components/emails/components' import { getBrandConfig } from '@/ee/whitelabeling' interface PaymentFailedEmailProps { userName?: string amountDue: number lastFourDigits?: string billingPortalUrl: string failureReason?: string sentDate?: Date } export function PaymentFailedEmail({ userName, amountDue, lastFourDigits, billingPortalUrl, failureReason, sentDate = new Date(), }: PaymentFailedEmailProps) { const brand = getBrandConfig() const previewText = `${brand.name}: Payment Failed - Action Required` return ( {userName ? `Hi ${userName},` : 'Hi,'} We were unable to process your payment. Your {brand.name} account has been temporarily blocked to prevent service interruptions and unexpected charges. To restore access immediately, please update your payment method.
Payment Details Amount due: ${amountDue.toFixed(2)} {lastFourDigits && ( Payment method: •••• {lastFourDigits} )} {failureReason && ( Reason: {failureReason} )}
Update Payment Method {/* Divider */}
What happens next? • Your workflows and automations are currently paused
• Update your payment method to restore service immediately
• Stripe will automatically retry the charge once payment is updated
{/* Divider */}
Common issues: expired card, insufficient funds, or incorrect billing info. Need help?{' '} {brand.supportEmail} ) } export default PaymentFailedEmail