mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-07 06:06:08 +02:00
🌐 Make discount value a parameter (#1557)
This commit is contained in:
parent
8ff805829f
commit
17d386d905
4 changed files with 16 additions and 6 deletions
|
@ -266,6 +266,8 @@ export async function POST(request: NextRequest) {
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
name: session.customer_details?.name ?? undefined,
|
name: session.customer_details?.name ?? undefined,
|
||||||
|
discount: 20,
|
||||||
|
couponCode: "GETPRO1Y20",
|
||||||
recoveryUrl,
|
recoveryUrl,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
"abandoned_checkout_offer": "To help you get started, you can get <b>{{discount}}% off</b> your first year. Just use the code below when you check out:",
|
"abandoned_checkout_offer": "To help you get started, you can get <b>{{discount}}% off</b> your first year. Just use the code below when you check out:",
|
||||||
"abandoned_checkout_button": "Upgrade to Rallly Pro",
|
"abandoned_checkout_button": "Upgrade to Rallly Pro",
|
||||||
"abandoned_checkout_support": "If you have any questions about Rallly Pro or need help with anything at all, just reply to this email. I'm here to help!",
|
"abandoned_checkout_support": "If you have any questions about Rallly Pro or need help with anything at all, just reply to this email. I'm here to help!",
|
||||||
"abandoned_checkout_preview": "Exclusive offer: Get 20% off your first year of Rallly Pro!",
|
"abandoned_checkout_preview": "Exclusive offer: Get {{discount}}% off your first year of Rallly Pro!",
|
||||||
"abandoned_checkout_subject": "Get 20% off your first year of Rallly Pro",
|
"abandoned_checkout_subject": "Get {{discount}}% off your first year of Rallly Pro",
|
||||||
"abandoned_checkout_signoff": "Best regards,"
|
"abandoned_checkout_signoff": "Best regards,"
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ export default function AbandonedCheckoutEmailPreview() {
|
||||||
return (
|
return (
|
||||||
<AbandonedCheckoutEmail
|
<AbandonedCheckoutEmail
|
||||||
ctx={previewEmailContext}
|
ctx={previewEmailContext}
|
||||||
|
discount={20}
|
||||||
|
couponCode="GETPRO1Y20"
|
||||||
recoveryUrl="https://example.com"
|
recoveryUrl="https://example.com"
|
||||||
name="John Doe"
|
name="John Doe"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -7,12 +7,16 @@ import type { EmailContext } from "../types";
|
||||||
|
|
||||||
interface AbandonedCheckoutEmailProps {
|
interface AbandonedCheckoutEmailProps {
|
||||||
recoveryUrl: string;
|
recoveryUrl: string;
|
||||||
|
discount: number;
|
||||||
|
couponCode: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
ctx: EmailContext;
|
ctx: EmailContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AbandonedCheckoutEmail = ({
|
export const AbandonedCheckoutEmail = ({
|
||||||
recoveryUrl,
|
recoveryUrl,
|
||||||
|
discount,
|
||||||
|
couponCode,
|
||||||
name,
|
name,
|
||||||
ctx,
|
ctx,
|
||||||
}: AbandonedCheckoutEmailProps) => {
|
}: AbandonedCheckoutEmailProps) => {
|
||||||
|
@ -22,7 +26,8 @@ export const AbandonedCheckoutEmail = ({
|
||||||
poweredBy={false}
|
poweredBy={false}
|
||||||
preview={ctx.t("abandoned_checkout_preview", {
|
preview={ctx.t("abandoned_checkout_preview", {
|
||||||
defaultValue:
|
defaultValue:
|
||||||
"Exclusive offer: Get 20% off your first year of Rallly Pro!",
|
"Exclusive offer: Get {{discount}}% off your first year of Rallly Pro!",
|
||||||
|
discount,
|
||||||
ns: "emails",
|
ns: "emails",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
@ -68,7 +73,7 @@ export const AbandonedCheckoutEmail = ({
|
||||||
defaults="To help you get started, I'd like to offer you <b>{{discount}}% off your first year</b> with Rallly Pro. Simply use this code during checkout:"
|
defaults="To help you get started, I'd like to offer you <b>{{discount}}% off your first year</b> with Rallly Pro. Simply use this code during checkout:"
|
||||||
ns="emails"
|
ns="emails"
|
||||||
values={{
|
values={{
|
||||||
discount: 20,
|
discount,
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
b: <b />,
|
b: <b />,
|
||||||
|
@ -84,7 +89,7 @@ export const AbandonedCheckoutEmail = ({
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
GETPRO1Y20
|
{couponCode}
|
||||||
</Text>
|
</Text>
|
||||||
</Card>
|
</Card>
|
||||||
<Button href={recoveryUrl} id="recoveryUrl">
|
<Button href={recoveryUrl} id="recoveryUrl">
|
||||||
|
@ -131,7 +136,8 @@ AbandonedCheckoutEmail.getSubject = (
|
||||||
return (
|
return (
|
||||||
"🎉 " +
|
"🎉 " +
|
||||||
ctx.t("abandoned_checkout_subject", {
|
ctx.t("abandoned_checkout_subject", {
|
||||||
defaultValue: "Get 20% off your first year of Rallly Pro",
|
defaultValue: "Get {{discount}}% off your first year of Rallly Pro",
|
||||||
|
discount: props.discount,
|
||||||
ns: "emails",
|
ns: "emails",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue