From be45d558756b1622944ba890415f6190537081a8 Mon Sep 17 00:00:00 2001 From: Hendrik Saly Date: Mon, 30 Dec 2024 17:46:55 +0100 Subject: [PATCH] Add execute actions template --- .../templates/email-update-confirmation.tsx | 7 +-- emails/templates/email-verification.tsx | 8 ++-- emails/templates/executeActions.tsx | 47 +++++++++++++++++++ emails/templates/password-reset.tsx | 3 +- package.json | 2 +- 5 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 emails/templates/executeActions.tsx diff --git a/emails/templates/email-update-confirmation.tsx b/emails/templates/email-update-confirmation.tsx index 76f3d6d..773b417 100644 --- a/emails/templates/email-update-confirmation.tsx +++ b/emails/templates/email-update-confirmation.tsx @@ -27,10 +27,11 @@ export const Template = ({ locale }: TemplateProps) => ( emailAddress={exp("user.email")} preview={"Confirm email address update"}> - To update your MEOD account with email address {exp("newEmail")}, - click the link below + To change the email address to {exp("newEmail")} for your MEOD account, + click the link below.

- This link will expire within {exp("linkExpirationFormatter(linkExpiration)")}. + This link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.
+ If the link is already expired, just try to login and a new verification link will be sent.

If you don't want to proceed with this modification, just ignore this message. diff --git a/emails/templates/email-verification.tsx b/emails/templates/email-verification.tsx index 0ee8956..b19a6e6 100644 --- a/emails/templates/email-verification.tsx +++ b/emails/templates/email-verification.tsx @@ -28,11 +28,11 @@ export const Template = ({ locale }: TemplateProps) => ( emailAddress={exp("user.email")} preview={"Verify your email address"}> - Someone has created a {exp("user.firstName")} account with this email address. If - this was you, click the link below to verify your email address + Someone has created a MEOD account with this email address ({exp("user.email")}). If + this was you, click the link below to verify your email address.

- The link will expire within {exp("linkExpirationFormatter(linkExpiration)")}. - If the link is already expired just try to login and a new verification link will be sent. + The link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.
+ If the link is already expired, just try to login and a new verification link will be sent.

If you didn't create this account, just ignore this message. diff --git a/emails/templates/executeActions.tsx b/emails/templates/executeActions.tsx new file mode 100644 index 0000000..5d0a4b5 --- /dev/null +++ b/emails/templates/executeActions.tsx @@ -0,0 +1,47 @@ +import { Text, render } from "jsx-email"; +import { EmailLayout} from "../eliatra-layout"; +import { + createVariablesHelper, + GetSubject, + GetTemplate, + GetTemplateProps, +} from "keycloakify-emails"; + +interface TemplateProps extends Omit {} + +export const previewProps: TemplateProps = { + locale: "en", + themeName: "vanilla", +}; + +export const templateName = "Execute Actions"; + +const { exp } = createVariablesHelper("executeActions.ftl"); + +export const Template = ({ locale }: TemplateProps) => ( + + + Someone has requested to update or set your MEOD account password. If + this was you, click the link below. +

+ The link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.
+ If the link is already expired, just try to login and a new verification link will be sent. +

+ If you didn't create or request this change, just ignore this message. +
+); + +export const getTemplate: GetTemplate = async (props) => { + return await render(