mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-29 11:05:33 +02:00
feat: implement invitation email functionality for organization creation
- Added `sendInvitationEmail` function to send invitation emails when a new organization is created in the cloud environment. - Updated email template to enhance the invitation message and included a direct link for users to accept the invitation. - Refactored email sending logic in the user router to utilize the new invitation email rendering function. - Improved organization invitation email design for better user experience.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { renderAsync } from "@react-email/components";
|
||||
import InvitationEmail from "../emails/emails/invitation";
|
||||
import VerifyEmailTemplate from "../emails/emails/verify-email";
|
||||
import { sendEmailNotification } from "../utils/notifications/utils";
|
||||
|
||||
@@ -51,3 +52,38 @@ export const sendVerificationEmail = async ({
|
||||
text: html,
|
||||
});
|
||||
};
|
||||
|
||||
export const renderInvitationEmail = async ({
|
||||
email,
|
||||
inviteLink,
|
||||
organizationName,
|
||||
}: {
|
||||
email: string;
|
||||
inviteLink: string;
|
||||
organizationName: string;
|
||||
}) => {
|
||||
return renderAsync(
|
||||
InvitationEmail({
|
||||
inviteLink,
|
||||
toEmail: email,
|
||||
organizationName,
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
export const sendInvitationEmail = async ({
|
||||
email,
|
||||
inviteLink,
|
||||
organizationName,
|
||||
}: {
|
||||
email: string;
|
||||
inviteLink: string;
|
||||
organizationName: string;
|
||||
}) => {
|
||||
const html = await renderInvitationEmail({ email, inviteLink, organizationName });
|
||||
await sendEmail({
|
||||
email,
|
||||
subject: `You've been invited to join ${organizationName} on Dokploy`,
|
||||
text: html,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user