Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Disable escaped characters in emails (#1369)

Luke Vellad550f53b722e
diff --git a/packages/emails/src/i18n.ts b/packages/emails/src/i18n.ts
index 87545c331..9b7512eb6 100644
--- a/packages/emails/src/i18n.ts
+++ b/packages/emails/src/i18n.ts
@@ -1,3 +1,4 @@
+import type { InitOptions } from "i18next";
import { createInstance } from "i18next";
import resourcesToBackend from "i18next-resources-to-backend";
import { initReactI18next } from "react-i18next/initReactI18next";
@@ -13,12 +14,15 @@ i18nInstance
),
);
-const i18nDefaultConfig = {
+const i18nDefaultConfig: InitOptions = {
lng: "en",
fallbackLng: "en",
ns: ["emails"],
fallbackNS: "emails",
defaultNS: "emails",
+ interpolation: {
+ escapeValue: false,
+ },
} as const;
export type I18nInstance = typeof i18nInstance;
diff --git a/packages/emails/src/templates/finalized-host.tsx b/packages/emails/src/templates/finalized-host.tsx
index 8bba8b85e..7fd114b90 100644
--- a/packages/emails/src/templates/finalized-host.tsx
+++ b/packages/emails/src/templates/finalized-host.tsx
@@ -39,6 +39,7 @@ const FinalizeHostEmail = ({
ns: "emails",
defaultValue:
"Final date booked! We've notified participants and sent them calendar invites.",
+ title,
})}
>
<Heading>
@@ -54,7 +55,6 @@ const FinalizeHostEmail = ({
i18nKey="finalizeHost_content"
ns="emails"
values={{ title }}
- shouldUnescape={true}
components={{
b: <strong />,
}}
@@ -126,9 +126,6 @@ FinalizeHostEmail.getSubject = (
defaultValue: "Date booked for {{title}}",
title: props.title,
ns: "emails",
- interpolation: {
- escapeValue: false,
- },
});
};
diff --git a/packages/emails/src/templates/finalized-participant.tsx b/packages/emails/src/templates/finalized-participant.tsx
index f2b12d2ca..2dd047197 100644
--- a/packages/emails/src/templates/finalized-participant.tsx
+++ b/packages/emails/src/templates/finalized-participant.tsx
@@ -53,7 +53,6 @@ const FinalizeParticipantEmail = ({
ns="emails"
defaults="<b>{{hostName}}</b> has booked <b>{{title}}</b> for the following date:"
values={{ hostName, title }}
- shouldUnescape={true}
components={{
b: <strong />,
}}
@@ -118,9 +117,6 @@ FinalizeParticipantEmail.getSubject = (
defaultValue: "Date booked for {{title}}",
title: props.title,
ns: "emails",
- interpolation: {
- escapeValue: false,
- },
});
};
diff --git a/packages/emails/src/templates/new-comment.tsx b/packages/emails/src/templates/new-comment.tsx
index fffdfda8b..ac2c878bf 100644
--- a/packages/emails/src/templates/new-comment.tsx
+++ b/packages/emails/src/templates/new-comment.tsx
@@ -42,7 +42,6 @@ const NewCommentEmail = ({
ns="emails"
i18nKey="newComment_content"
defaults="<b>{{authorName}}</b> has commented on <b>{{title}}</b>."
- shouldUnescape={true}
components={{
b: <strong />,
}}
@@ -65,9 +64,6 @@ NewCommentEmail.getSubject = (
defaultValue: "{{authorName}} has commented on {{title}}",
authorName: props.authorName,
title: props.title,
- interpolation: {
- escapeValue: false,
- },
});
};
diff --git a/packages/emails/src/templates/new-participant.tsx b/packages/emails/src/templates/new-participant.tsx
index 270c27117..7a50aa959 100644
--- a/packages/emails/src/templates/new-participant.tsx
+++ b/packages/emails/src/templates/new-participant.tsx
@@ -69,9 +69,6 @@ NewParticipantEmail.getSubject = (
name: props.participantName,
title: props.title,
ns: "emails",
- interpolation: {
- escapeValue: false,
- },
});
};
diff --git a/packages/emails/src/templates/new-poll.tsx b/packages/emails/src/templates/new-poll.tsx
index a7dad976f..de43f6a6d 100644
--- a/packages/emails/src/templates/new-poll.tsx
+++ b/packages/emails/src/templates/new-poll.tsx
@@ -46,7 +46,6 @@ export const NewPollEmail = ({
i18nKey="newPoll_content"
ns="emails"
values={{ title }}
- shouldUnescape={true}
components={{
b: <strong />,
}}
@@ -72,9 +71,6 @@ NewPollEmail.getSubject = (props: NewPollEmailProps, ctx: EmailContext) => {
return ctx.t("newPoll_subject", {
defaultValue: "Let's find a date for {{title}}!",
title: props.title,
- interpolation: {
- escapeValue: false,
- },
ns: "emails",
});
};