diff --git a/server/email.ts b/server/email.ts index ceb8d0d7..f1ad8e5c 100644 --- a/server/email.ts +++ b/server/email.ts @@ -67,4 +67,51 @@ export const emailService = { reply_to: verifySupportEmail, }); }, + + async sendInviteEmail(params: { + to: string; + inviteUrl: string; + inviterName?: string | null; + message?: string | null; + }) { + if (!resendClient) { + throw new Error("Email service is not configured. Set RESEND_API_KEY."); + } + + const { to, inviteUrl, inviterName, message } = params; + const safeInviter = inviterName?.trim() || "An AeThex member"; + + const subject = `${safeInviter} invited you to collaborate on AeThex`; + + const html = ` +
${safeInviter} sent you an invitation to connect and collaborate on AeThex.
+ ${message ? `${message}` : ""} + +
If the button does not work, paste this link into your browser:
+${inviteUrl}
+