feat: Workflow — Send Email to Specific Email (#14815)

* feat: Workflow — Send Email to Specific Email

* disable button when verifyEmail pending

* add verified emails table and routes

* fix: include teamId in verifyEmailCode

* fix: include email address in activate handler

* fix: check team before adding email

* feat: check verified email, add to team if only users

* remove logs

* fix: if statement

Co-authored-by: Carina Wollendorfer <[email protected]>

* change email to verify your email

* fix: show error if saving unverified email

* fix: show email in subject

* verify email when editing steps

* remove double calls from same block

* verify email when creating new step

---------

Co-authored-by: v0ltZzie <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-05-20 21:23:19 +00:00
1 parent 5ee3744015
commit bd6c471652
21 files changed
+491 -70

No files matched your search

+8 -1
View File
@@ -20,6 +20,7 @@ interface VerifyEmailType {
email: string;
language?: string;
secondaryEmailId?: number;
isVerifyingEmail?: boolean;
isPlatform?: boolean;
}
@@ -75,7 +76,12 @@ export const sendEmailVerification = async ({
return { ok: true, skipped: false };
};
export const sendEmailVerificationByCode = async ({ email, language, username }: VerifyEmailType) => {
export const sendEmailVerificationByCode = async ({
email,
language,
username,
isVerifyingEmail,
}: VerifyEmailType) => {
const translation = await getTranslation(language ?? "en", "common");
const secret = createHash("md5")
.update(email + process.env.CALENDSO_ENCRYPTION_KEY)
@@ -91,6 +97,7 @@ export const sendEmailVerificationByCode = async ({ email, language, username }:
email,
name: username,
},
isVerifyingEmail,
});
return { ok: true, skipped: false };