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
103 lines
3.1 KiB
TypeScript
103 lines
3.1 KiB
TypeScript
import { Link, Section, Text } from '@react-email/components'
|
|
import { baseStyles, colors, typography } from '@/components/emails/_styles'
|
|
import { proFeatures } from '@/components/emails/billing/constants'
|
|
import { EmailLayout } from '@/components/emails/components'
|
|
import { dollarsToCredits } from '@/lib/billing/credits/conversion'
|
|
import { getBrandConfig } from '@/ee/whitelabeling'
|
|
|
|
interface CreditsExhaustedEmailProps {
|
|
userName?: string
|
|
limit: number
|
|
upgradeLink: string
|
|
}
|
|
|
|
export function CreditsExhaustedEmail({
|
|
userName,
|
|
limit,
|
|
upgradeLink,
|
|
}: CreditsExhaustedEmailProps) {
|
|
const brand = getBrandConfig()
|
|
|
|
return (
|
|
<EmailLayout
|
|
preview={`You've used all ${dollarsToCredits(limit).toLocaleString()} of your free ${brand.name} credits`}
|
|
showUnsubscribe={true}
|
|
>
|
|
<Text style={{ ...baseStyles.paragraph, marginTop: 0 }}>
|
|
{userName ? `Hi ${userName},` : 'Hi,'}
|
|
</Text>
|
|
|
|
<Text style={baseStyles.paragraph}>
|
|
You've used all <strong>{dollarsToCredits(limit).toLocaleString()}</strong> of your
|
|
free credits on {brand.name}. Your workflows are paused until you upgrade.
|
|
</Text>
|
|
|
|
<Section
|
|
style={{
|
|
backgroundColor: colors.surfaceSubtle,
|
|
border: `1px solid ${colors.brandTertiary}20`,
|
|
borderRadius: '8px',
|
|
padding: '16px 20px',
|
|
margin: '16px 0',
|
|
}}
|
|
>
|
|
<Text
|
|
style={{
|
|
fontSize: '14px',
|
|
fontWeight: 600,
|
|
color: colors.brandTertiary,
|
|
fontFamily: typography.fontFamily,
|
|
margin: '0 0 12px 0',
|
|
textTransform: 'uppercase' as const,
|
|
letterSpacing: '0.5px',
|
|
}}
|
|
>
|
|
Pro includes
|
|
</Text>
|
|
<table style={{ width: '100%', borderCollapse: 'collapse' }}>
|
|
<tbody>
|
|
{proFeatures.map((feature, i) => (
|
|
<tr key={i}>
|
|
<td
|
|
style={{
|
|
padding: '6px 0',
|
|
fontSize: '15px',
|
|
fontWeight: 600,
|
|
color: colors.textPrimary,
|
|
fontFamily: typography.fontFamily,
|
|
width: '45%',
|
|
}}
|
|
>
|
|
{feature.label}
|
|
</td>
|
|
<td
|
|
style={{
|
|
padding: '6px 0',
|
|
fontSize: '14px',
|
|
color: colors.textMuted,
|
|
fontFamily: typography.fontFamily,
|
|
}}
|
|
>
|
|
{feature.desc}
|
|
</td>
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</Section>
|
|
|
|
<Link href={upgradeLink} style={{ textDecoration: 'none' }}>
|
|
<Text style={baseStyles.button}>Upgrade to Pro</Text>
|
|
</Link>
|
|
|
|
<div style={baseStyles.divider} />
|
|
|
|
<Text style={{ ...baseStyles.footerText, textAlign: 'left' }}>
|
|
One-time notification when free credits are exhausted.
|
|
</Text>
|
|
</EmailLayout>
|
|
)
|
|
}
|
|
|
|
export default CreditsExhaustedEmail
|