import React from "react"; import { Body, Head, Html, Preview, Tailwind } from "@react-email/components"; import { themeColors } from "./lib/theme"; import { EmailContainer, EmailFooter, EmailGreeting, EmailHeading, EmailLetterHead, EmailSignature, EmailText } from "./components/Email"; interface Props { email: string; orgName: string; trialEndsAt: string; daysRemaining: number | null; billingLink: string; } export const NotifyTrialExpiring = ({ email, orgName, trialEndsAt, daysRemaining, billingLink }: Props) => { const hasEnded = daysRemaining === null || daysRemaining === 0; const isLastDay = daysRemaining === 1; const previewText = hasEnded ? `Your trial for ${orgName} has ended.` : isLastDay ? `Your trial for ${orgName} ends tomorrow.` : `Your trial for ${orgName} ends in ${daysRemaining} days.`; const heading = hasEnded ? "Your Trial Ended" : "Your Trial is Ending Soon"; return ( {previewText} {heading} Hi there, {hasEnded ? ( <> Your free trial for{" "} {orgName} ended on{" "} {trialEndsAt}. Your account has been moved to the free plan, which includes limited functionality. Some features and resources may now be restricted or disconnected. To restore full access and continue using all the features you had during your trial, please upgrade to a paid plan. You can{" "} upgrade your plan here {" "} to get back up and running right away. ) : ( <> Just a reminder that your free trial for{" "} {orgName} will end on{" "} {trialEndsAt} {isLastDay ? " — that's tomorrow!" : `, in ${daysRemaining} days`} . After your trial ends, your account will be moved to the free plan and some functionality may be restricted or your sites may disconnect. To avoid any interruption to your service, we encourage you to upgrade before your trial expires. You can{" "} upgrade your plan here . )} If you have any questions or need assistance, please don't hesitate to reach out to our support team. ); }; export default NotifyTrialExpiring;