Skip to content

Commit

Permalink
Add execute actions template
Browse files Browse the repository at this point in the history
  • Loading branch information
salyh committed Dec 30, 2024
1 parent 20e868f commit be45d55
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 9 deletions.
7 changes: 4 additions & 3 deletions emails/templates/email-update-confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<br/><br/>
This link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.
This link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.<br/>
If the link is already expired, just try to login and a new verification link will be sent.
<br/><br/>
If you don't want to proceed with this modification, just ignore this message.
</EmailLayout>
Expand Down
8 changes: 4 additions & 4 deletions emails/templates/email-verification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<br/><br/>
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)")}.<br/>
If the link is already expired, just try to login and a new verification link will be sent.
<br/><br/>
If you didn't create this account, just ignore this message.
</EmailLayout>
Expand Down
47 changes: 47 additions & 0 deletions emails/templates/executeActions.tsx
Original file line number Diff line number Diff line change
@@ -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<GetTemplateProps, "plainText"> {}

export const previewProps: TemplateProps = {
locale: "en",
themeName: "vanilla",
};

export const templateName = "Execute Actions";

const { exp } = createVariablesHelper("executeActions.ftl");

export const Template = ({ locale }: TemplateProps) => (
<EmailLayout
userFirstname={exp("user.firstName")}
userLastname={exp("user.lastName")}
locale={locale}
buttonText={"Update or set your MEOD account password"}
buttonLink={exp("link")}
emailAddress={exp("user.email")}
preview={"Update or set your MEOD account password"}>

Someone has requested to update or set your MEOD account password. If
this was you, click the link below.
<br/><br/>
The link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.<br/>
If the link is already expired, just try to login and a new verification link will be sent.
<br/><br/>
If you didn't create or request this change, just ignore this message.
</EmailLayout>
);

export const getTemplate: GetTemplate = async (props) => {
return await render(<Template {...props} />, { plainText: props.plainText });
};

export const getSubject: GetSubject = async (_props) => {
return "Update your MEOD account";
};
3 changes: 2 additions & 1 deletion emails/templates/password-reset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const Template = ({ locale }: TemplateProps) => (
Someone just requested to change your {exp("realmName")} account's credentials. If
this was you, click on the link below to reset them.
<br/><br/>
This link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.
This link will expire within {exp("linkExpirationFormatter(linkExpiration)")}.<br/>
If the link is already expired, just try to login and a new verification link will be sent.
<br/><br/>
If you don't want to reset your credentials, just ignore this message and nothing
will be changed.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meod",
"version": "1.0.4",
"version": "1.0.5",
"description": "Keycloakify 11 template for meod",
"repository": {
"type": "git",
Expand Down

0 comments on commit be45d55

Please sign in to comment.