Skip to content

Commit a51fbe3

Browse files
authored
Merge pull request #396 from trycompai/lewis/comp-95-add-users-to-resend-on-sign-up
feat: enhance contact creation with user names in organization actions
2 parents 93d034a + 5951d7e commit a51fbe3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

apps/app/src/actions/organization/accept-invitation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ export const completeInvitation = authActionClient
141141
const resend = new Resend(process.env.RESEND_API_KEY);
142142

143143
await resend.contacts.create({
144+
firstName: user.name?.split(" ")[0] || "",
145+
lastName: user.name?.split(" ")[1] || "",
144146
email: user.email,
145147
unsubscribed: false,
146148
audienceId: process.env.RESEND_AUDIENCE_ID,

apps/app/src/actions/organization/create-organization-action.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export const createOrganizationAction = authActionClient
6262
const resend = new Resend(process.env.RESEND_API_KEY);
6363

6464
await resend.contacts.create({
65+
firstName: session.user.name?.split(" ")[0] || "",
66+
lastName: session.user.name?.split(" ")[1] || "",
6567
email: session.user.email,
6668
unsubscribed: false,
6769
audienceId: process.env.RESEND_AUDIENCE_ID,

0 commit comments

Comments
 (0)