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.

Update invite-partner.ts

Kiran K6348f814d679
diff --git a/apps/web/lib/api/partners/invite-partner.ts b/apps/web/lib/api/partners/invite-partner.ts
index c8d732828a..b68b511498 100644
--- a/apps/web/lib/api/partners/invite-partner.ts
+++ b/apps/web/lib/api/partners/invite-partner.ts
@@ -72,6 +72,7 @@ export const invitePartner = async ({
},
}),
+ // update link to have programId
prisma.link.update({
where: {
id: link.id,
@@ -81,11 +82,7 @@ export const invitePartner = async ({
},
}),
- updateConfig({
- key: "partnersPortal",
- value: email,
- }),
-
+ // record link update in tinybird
recordLink({
domain: link.domain,
key: link.key,
@@ -98,19 +95,25 @@ export const invitePartner = async ({
deleted: false,
}),
- sendEmail({
- subject: `${program.name} invited you to join Dub Partners`,
- email,
- react: PartnerInvite({
- email,
- appName: `${process.env.NEXT_PUBLIC_APP_NAME}`,
- program: {
- name: program.name,
- logo: program.logo,
- },
- }),
+ // TODO: Remove this once we open up partners.dub.co to everyone
+ updateConfig({
+ key: "partnersPortal",
+ value: email,
}),
]);
+ await sendEmail({
+ subject: `${program.name} invited you to join Dub Partners`,
+ email,
+ react: PartnerInvite({
+ email,
+ appName: `${process.env.NEXT_PUBLIC_APP_NAME}`,
+ program: {
+ name: program.name,
+ logo: program.logo,
+ },
+ }),
+ });
+
return programInvited;
};