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.

support partners.dub.co audienceId

Kiran K39509811d188
diff --git a/packages/email/src/resend/unsubscribe.ts b/packages/email/src/resend/unsubscribe.ts
index 8a351e9d3c..5f98fac9e3 100644
--- a/packages/email/src/resend/unsubscribe.ts
+++ b/packages/email/src/resend/unsubscribe.ts
@@ -1,7 +1,13 @@
import { resend } from "./client";
import { RESEND_AUDIENCES } from "./constants";
-export async function unsubscribe({ email }: { email: string }) {
+export async function unsubscribe({
+ email,
+ audience = "app.dub.co",
+}: {
+ email: string;
+ audience?: keyof typeof RESEND_AUDIENCES;
+}) {
if (!resend) {
console.error(
"Resend client is not properly initialized. Skipping operation.",
@@ -9,8 +15,7 @@ export async function unsubscribe({ email }: { email: string }) {
return;
}
- // TODO: Update this to support partners.dub.co in the future
- const audienceId = RESEND_AUDIENCES["app.dub.co"];
+ const audienceId = RESEND_AUDIENCES[audience];
return await resend.contacts.remove({
email,