d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
110 lines
3.3 KiB
TypeScript
110 lines
3.3 KiB
TypeScript
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 (
|
|
<EmailLayout preview={previewText} showUnsubscribe={false}>
|
|
<Text style={{ ...baseStyles.paragraph, marginTop: 0 }}>
|
|
{userName ? `Hi ${userName},` : 'Hi,'}
|
|
</Text>
|
|
|
|
<Text
|
|
style={{
|
|
...baseStyles.paragraph,
|
|
fontSize: '16px',
|
|
fontWeight: 600,
|
|
color: colors.textPrimary,
|
|
}}
|
|
>
|
|
We were unable to process your payment.
|
|
</Text>
|
|
|
|
<Text style={baseStyles.paragraph}>
|
|
Your {brand.name} account has been temporarily blocked to prevent service interruptions and
|
|
unexpected charges. To restore access immediately, please update your payment method.
|
|
</Text>
|
|
|
|
<Section
|
|
style={{
|
|
backgroundColor: colors.errorBg,
|
|
border: `1px solid ${colors.errorBorder}`,
|
|
borderRadius: '6px',
|
|
padding: '16px 18px',
|
|
margin: '16px 0',
|
|
}}
|
|
>
|
|
<Text
|
|
style={{
|
|
...baseStyles.paragraph,
|
|
marginBottom: 8,
|
|
marginTop: 0,
|
|
fontWeight: 'bold',
|
|
}}
|
|
>
|
|
Payment Details
|
|
</Text>
|
|
<Text style={{ ...baseStyles.paragraph, margin: '4px 0' }}>
|
|
Amount due: ${amountDue.toFixed(2)}
|
|
</Text>
|
|
{lastFourDigits && (
|
|
<Text style={{ ...baseStyles.paragraph, margin: '4px 0' }}>
|
|
Payment method: •••• {lastFourDigits}
|
|
</Text>
|
|
)}
|
|
{failureReason && (
|
|
<Text style={{ ...baseStyles.paragraph, margin: '4px 0' }}>Reason: {failureReason}</Text>
|
|
)}
|
|
</Section>
|
|
|
|
<Link href={billingPortalUrl} style={{ textDecoration: 'none' }}>
|
|
<Text style={baseStyles.button}>Update Payment Method</Text>
|
|
</Link>
|
|
|
|
{/* Divider */}
|
|
<div style={baseStyles.divider} />
|
|
|
|
<Text style={{ ...baseStyles.paragraph, fontWeight: 'bold' }}>What happens next?</Text>
|
|
|
|
<Text style={baseStyles.paragraph}>
|
|
• Your workflows and automations are currently paused
|
|
<br />• Update your payment method to restore service immediately
|
|
<br />• Stripe will automatically retry the charge once payment is updated
|
|
</Text>
|
|
|
|
{/* Divider */}
|
|
<div style={baseStyles.divider} />
|
|
|
|
<Text style={{ ...baseStyles.footerText, textAlign: 'left' }}>
|
|
Common issues: expired card, insufficient funds, or incorrect billing info. Need help?{' '}
|
|
<Link href={`mailto:${brand.supportEmail}`} style={baseStyles.link}>
|
|
{brand.supportEmail}
|
|
</Link>
|
|
</Text>
|
|
</EmailLayout>
|
|
)
|
|
}
|
|
|
|
export default PaymentFailedEmail
|