Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add PartnerPaypalPayoutFailed email template

Kiran K812e0e5d44c9
diff --git a/packages/email/src/templates/partner-paypal-payout-failed.tsx b/packages/email/src/templates/partner-paypal-payout-failed.tsx
new file mode 100644
index 0000000000..ca6ab7bd08
--- /dev/null
+++ b/packages/email/src/templates/partner-paypal-payout-failed.tsx
@@ -0,0 +1,106 @@
+import { currencyFormatter, DUB_WORDMARK } from "@dub/utils";
+import {
+ Body,
+ Container,
+ Head,
+ Heading,
+ Html,
+ Img,
+ Link,
+ Preview,
+ Section,
+ Tailwind,
+ Text,
+} from "@react-email/components";
+import { Footer } from "../components/footer";
+
+// Send this email to the partner when the paypal payout fails
+export default function PartnerPaypalPayoutFailed({
+ program = {
+ name: "Acme",
+ },
+ payout = {
+ amount: 530000,
+ failureReason: "This transaction was declined due to risk concerns.",
+ },
+ partner = {
+ paypalEmail: "[email protected]",
+ },
+ email = "[email protected]",
+}: {
+ program: {
+ name: string;
+ };
+ payout: {
+ amount: number; // in cents
+ failureReason: string;
+ };
+ partner: {
+ paypalEmail: string;
+ };
+ email: string;
+}) {
+ const amountFormatted = currencyFormatter(payout.amount / 100, {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2,
+ });
+
+ return (
+ <Html>
+ <Head />
+ <Preview>
+ Action Required - Your recent partner payout from {program.name} failed
+ </Preview>
+ <Tailwind>
+ <Body className="mx-auto my-auto bg-white font-sans">
+ <Container className="mx-auto my-8 max-w-[600px] px-8 py-8">
+ <Section className="mt-8">
+ <Img src={DUB_WORDMARK} height="32" alt="Dub" />
+ </Section>
+
+ <Heading className="mx-0 my-8 p-0 text-lg font-medium text-black">
+ Your recent partner payout from {program.name} failed
+ </Heading>
+
+ <Text>
+ We attempted to send your recent affiliate payout of{" "}
+ <span className="font-semibold text-purple-600">
+ {amountFormatted}
+ </span>{" "}
+ via PayPal to{" "}
+ <span className="font-semibold text-purple-600">
+ {partner.paypalEmail}
+ </span>
+ , but the transaction failed due to the following reason:
+ </Text>
+
+ <Text className="text-sm leading-6 text-neutral-600">
+ {payout.failureReason}
+ </Text>
+
+ <Text>
+ To resolve this issue, please update your PayPal account details
+ and retry the payout from your Payout Settings at your earliest
+ convenience.
+ </Text>
+
+ <Section className="my-8">
+ <Link
+ className="rounded-lg bg-neutral-900 px-6 py-3 text-[13px] font-medium text-white no-underline"
+ href="https://partners.dub.co/settings/payouts"
+ >
+ Payout Settings
+ </Link>
+ </Section>
+
+ <Text className="text-sm leading-6 text-neutral-600">
+ If you have any questions, just reply to this email.
+ </Text>
+
+ <Footer email={email} />
+ </Container>
+ </Body>
+ </Tailwind>
+ </Html>
+ );
+}