cal.pub0.org/lib/forgot-password/messaging/forgot-password.ts

29 lines
748 B
TypeScript
Raw Normal View History

import { TFunction } from "next-i18next";
2021-06-24 15:59:11 +00:00
import { buildMessageTemplate, VarType } from "../../emails/buildMessageTemplate";
2021-06-24 15:59:11 +00:00
export const forgotPasswordSubjectTemplate = (t: TFunction): string => {
const text = t("forgot_your_password_calcom");
return text;
};
export const forgotPasswordMessageTemplate = (t: TFunction): string => {
const text = `${t("hey_there")}
2021-06-24 15:59:11 +00:00
${t("use_link_to_reset_password")}
{{link}}
2021-06-24 15:59:11 +00:00
${t("link_expires", { expiresIn: 6 })}
2021-06-24 15:59:11 +00:00
- Cal.com`;
return text;
};
2021-06-24 15:59:11 +00:00
export const buildForgotPasswordMessage = (vars: VarType) => {
2021-06-24 15:59:11 +00:00
return buildMessageTemplate({
subjectTemplate: forgotPasswordSubjectTemplate(vars.language),
messageTemplate: forgotPasswordMessageTemplate(vars.language),
2021-06-24 15:59:11 +00:00
vars,
});
};