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.

added unsubscribe link via Resend

Steven Tey1991338689b2
diff --git a/emails/clicks-summary.tsx b/emails/clicks-summary.tsx
index 2f24c38467..f15e280c98 100644
--- a/emails/clicks-summary.tsx
+++ b/emails/clicks-summary.tsx
@@ -17,6 +17,7 @@ import {
import { Link2, MousePointerClick } from "lucide-react";
import { DUB_LOGO } from "../lib/constants";
import { nFormatter, truncate } from "../lib/utils";
+import Footer from "./components/footer";
export default function ClicksSummary({
email = "[email protected]",
@@ -167,14 +168,7 @@ export default function ClicksSummary({
</Section>
</>
)}
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this email, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} />
</Container>
</Body>
</Tailwind>
diff --git a/emails/components/footer.tsx b/emails/components/footer.tsx
new file mode 100644
index 0000000000..19810f5abc
--- /dev/null
+++ b/emails/components/footer.tsx
@@ -0,0 +1,34 @@
+import { Hr, Tailwind, Text } from "@react-email/components";
+
+export default function Footer({
+ email,
+ marketing,
+}: {
+ email: string;
+ marketing?: boolean;
+}) {
+ return (
+ <Tailwind>
+ <Hr className="mx-0 my-6 w-full border border-gray-200" />
+ {marketing ? (
+ <Text className="text-[12px] leading-6 text-gray-500">
+ This email was intended for{" "}
+ <span className="text-black">{email}</span>. If you were not expecting
+ this email, you can ignore this email. If you don't want to receive
+ emails like this in the future, you can{" "}
+ <a href="{{{RESEND_UNSUBSCRIBE_URL}}}" className="text-gray-600">
+ unsubscribe here
+ </a>
+ .
+ </Text>
+ ) : (
+ <Text className="text-[12px] leading-6 text-gray-500">
+ This email was intended for{" "}
+ <span className="text-black">{email}</span>. If you were not expecting
+ this email, you can ignore this email. If you are concerned about your
+ account's safety, please reply to this email to get in touch with us.
+ </Text>
+ )}
+ </Tailwind>
+ );
+}
diff --git a/emails/domain-deleted.tsx b/emails/domain-deleted.tsx
index 8ceee4f281..e05a8707a1 100644
--- a/emails/domain-deleted.tsx
+++ b/emails/domain-deleted.tsx
@@ -13,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { DUB_LOGO } from "../lib/constants";
+import Footer from "./components/footer";
export default function DomainDeleted({
email = "[email protected]",
@@ -70,14 +71,7 @@ export default function DomainDeleted({
If you did not want to keep using this domain on Dub anyway, you
can simply ignore this email.
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this email, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} />
</Container>
</Body>
</Tailwind>
diff --git a/emails/invalid-domain.tsx b/emails/invalid-domain.tsx
index 1d54852f81..096b9f5ded 100644
--- a/emails/invalid-domain.tsx
+++ b/emails/invalid-domain.tsx
@@ -13,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { DUB_LOGO } from "../lib/constants";
+import Footer from "./components/footer";
export default function InvalidDomain({
email = "[email protected]",
@@ -83,14 +84,7 @@ export default function InvalidDomain({
} days.`
: "this will be the last time we will email you about this."}
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this email, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} />
</Container>
</Body>
</Tailwind>
diff --git a/emails/login-link.tsx b/emails/login-link.tsx
index afd4b5471c..c08feb3337 100644
--- a/emails/login-link.tsx
+++ b/emails/login-link.tsx
@@ -13,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { DUB_LOGO } from "../lib/constants";
+import Footer from "./components/footer";
export default function LoginLink({
email = "[email protected]",
@@ -60,14 +61,7 @@ export default function LoginLink({
<Text className="max-w-sm flex-wrap break-words font-medium text-purple-600 no-underline">
{url.replace(/^https?:\/\//, "")}
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this email, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} />
</Container>
</Body>
</Tailwind>
diff --git a/emails/project-invite.tsx b/emails/project-invite.tsx
index 0594d08e43..afea550647 100644
--- a/emails/project-invite.tsx
+++ b/emails/project-invite.tsx
@@ -13,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { DUB_LOGO } from "../lib/constants";
+import Footer from "./components/footer";
export default function ProjectInvite({
email = "[email protected]",
@@ -71,14 +72,7 @@ export default function ProjectInvite({
<Text className="max-w-sm flex-wrap break-words font-medium text-purple-600 no-underline">
{url.replace(/^https?:\/\//, "")}
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This invitation was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this invitation, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} />
</Container>
</Body>
</Tailwind>
diff --git a/emails/upgrade-email.tsx b/emails/upgrade-email.tsx
index 923d8d9a31..32414eb66a 100644
--- a/emails/upgrade-email.tsx
+++ b/emails/upgrade-email.tsx
@@ -13,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { DUB_LOGO } from "../lib/constants";
+import Footer from "./components/footer";
export default function UpgradeEmail({
name = "Brendon Urie",
@@ -112,14 +113,7 @@ export default function UpgradeEmail({
Steven from Dub
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this email, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} marketing />
</Container>
</Body>
</Tailwind>
diff --git a/emails/usage-exceeded.tsx b/emails/usage-exceeded.tsx
index b32705dfbe..bbfbec1793 100644
--- a/emails/usage-exceeded.tsx
+++ b/emails/usage-exceeded.tsx
@@ -15,8 +15,10 @@ import {
import { DUB_LOGO } from "../lib/constants";
import { ProjectProps } from "../lib/types";
import { capitalize, nFormatter } from "../lib/utils";
+import Footer from "./components/footer";
export default function UsageExceeded({
+ email = "[email protected]",
project = {
id: "ckqf1q3xw0000gk5u2q1q2q1q",
name: "Acme",
@@ -27,6 +29,7 @@ export default function UsageExceeded({
},
type = "first",
}: {
+ email: string;
project: ProjectProps;
type: "first" | "second";
}) {
@@ -78,14 +81,7 @@ export default function UsageExceeded({
. Feel free to ignore this email if you don't plan on upgrading,
or reply to let us know if you have any questions!
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for members of the{" "}
- <span className="text-black">{project.name}</span> project on Dub.
- If you were not expecting this email, you can ignore this email.
- If you are concerned about your account's safety, please reply to
- this email to get in touch with us.
- </Text>
+ <Footer email={email} />
</Container>
</Body>
</Tailwind>
diff --git a/emails/welcome-email.tsx b/emails/welcome-email.tsx
index d2fb19c8ca..55eb14e5db 100644
--- a/emails/welcome-email.tsx
+++ b/emails/welcome-email.tsx
@@ -13,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { DUB_LOGO, DUB_THUMBNAIL } from "../lib/constants";
+import Footer from "./components/footer";
export default function WelcomeEmail({
name = "Brendon Urie",
@@ -90,14 +91,7 @@ export default function WelcomeEmail({
Steven from Dub
</Text>
- <Hr className="mx-0 my-6 w-full border border-gray-200" />
- <Text className="text-[12px] leading-6 text-gray-500">
- This email was intended for{" "}
- <span className="text-black">{email}</span>. If you were not
- expecting this email, you can ignore this email. If you are
- concerned about your account's safety, please reply to this email
- to get in touch with us.
- </Text>
+ <Footer email={email} marketing />
</Container>
</Body>
</Tailwind>
diff --git a/lib/cron/usage.tsx b/lib/cron/usage.tsx
index b03361b390..b78f04b03f 100644
--- a/lib/cron/usage.tsx
+++ b/lib/cron/usage.tsx
@@ -176,6 +176,7 @@ const sendUsageLimitEmail = async (
subject: `You have exceeded your Dub usage limit`,
email,
react: UsageExceeded({
+ email,
project,
type,
}),