first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
48
packages/mail/emails/EmailVerification.tsx
Normal file
48
packages/mail/emails/EmailVerification.tsx
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import { Link, Text } from "@react-email/components";
|
||||
import React from "react";
|
||||
import { createTranslator } from "use-intl/core";
|
||||
import PrimaryButton from "../src/components/PrimaryButton";
|
||||
import Wrapper from "../src/components/Wrapper";
|
||||
import { defaultLocale, defaultTranslations } from "../src/util/translations";
|
||||
import type { BaseMailProps } from "../types";
|
||||
|
||||
export function EmailVerification({
|
||||
url,
|
||||
name,
|
||||
locale,
|
||||
translations,
|
||||
}: {
|
||||
url: string;
|
||||
name: string;
|
||||
} & BaseMailProps) {
|
||||
const t = createTranslator({
|
||||
locale,
|
||||
messages: translations,
|
||||
});
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Text>{t("mail.emailVerification.body", { name })}</Text>
|
||||
|
||||
<PrimaryButton href={url}>
|
||||
{t("mail.emailVerification.confirmEmail")} →
|
||||
</PrimaryButton>
|
||||
|
||||
<Text className="text-muted-foreground text-sm">
|
||||
{t("mail.common.openLinkInBrowser")}
|
||||
<Link href={url} className="break-all">
|
||||
{url}
|
||||
</Link>
|
||||
</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
EmailVerification.PreviewProps = {
|
||||
locale: defaultLocale,
|
||||
translations: defaultTranslations,
|
||||
url: "#",
|
||||
name: "John Doe",
|
||||
};
|
||||
|
||||
export default EmailVerification;
|
||||
46
packages/mail/emails/ForgotPassword.tsx
Normal file
46
packages/mail/emails/ForgotPassword.tsx
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { Link, Text } from "@react-email/components";
|
||||
import React from "react";
|
||||
import { createTranslator } from "use-intl/core";
|
||||
import PrimaryButton from "../src/components/PrimaryButton";
|
||||
import Wrapper from "../src/components/Wrapper";
|
||||
import { defaultLocale } from "../src/util/translations";
|
||||
import { defaultTranslations } from "../src/util/translations";
|
||||
import type { BaseMailProps } from "../types";
|
||||
|
||||
export function ForgotPassword({
|
||||
url,
|
||||
locale,
|
||||
translations,
|
||||
}: {
|
||||
url: string;
|
||||
name: string;
|
||||
} & BaseMailProps) {
|
||||
const t = createTranslator({
|
||||
locale,
|
||||
messages: translations,
|
||||
});
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Text>{t("mail.forgotPassword.body")}</Text>
|
||||
|
||||
<PrimaryButton href={url}>
|
||||
{t("mail.forgotPassword.resetPassword")} →
|
||||
</PrimaryButton>
|
||||
|
||||
<Text className="text-muted-foreground text-sm">
|
||||
{t("mail.common.openLinkInBrowser")}
|
||||
<Link href={url}>{url}</Link>
|
||||
</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
ForgotPassword.PreviewProps = {
|
||||
locale: defaultLocale,
|
||||
translations: defaultTranslations,
|
||||
url: "#",
|
||||
name: "John Doe",
|
||||
};
|
||||
|
||||
export default ForgotPassword;
|
||||
46
packages/mail/emails/MagicLink.tsx
Normal file
46
packages/mail/emails/MagicLink.tsx
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { Link, Text } from "@react-email/components";
|
||||
import React from "react";
|
||||
import { createTranslator } from "use-intl/core";
|
||||
import PrimaryButton from "../src/components/PrimaryButton";
|
||||
import Wrapper from "../src/components/Wrapper";
|
||||
import { defaultTranslations } from "../src/util/translations";
|
||||
import { defaultLocale } from "../src/util/translations";
|
||||
import type { BaseMailProps } from "../types";
|
||||
|
||||
export function MagicLink({
|
||||
url,
|
||||
locale,
|
||||
translations,
|
||||
}: {
|
||||
url: string;
|
||||
} & BaseMailProps) {
|
||||
const t = createTranslator({
|
||||
locale,
|
||||
messages: translations,
|
||||
});
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Text>{t("mail.magicLink.body")}</Text>
|
||||
|
||||
<Text>{t("mail.common.useLink")}</Text>
|
||||
|
||||
<PrimaryButton href={url}>
|
||||
{t("mail.magicLink.login")} →
|
||||
</PrimaryButton>
|
||||
|
||||
<Text className="text-muted-foreground text-sm">
|
||||
{t("mail.common.openLinkInBrowser")}
|
||||
<Link href={url}>{url}</Link>
|
||||
</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
MagicLink.PreviewProps = {
|
||||
locale: defaultLocale,
|
||||
translations: defaultTranslations,
|
||||
url: "#",
|
||||
};
|
||||
|
||||
export default MagicLink;
|
||||
58
packages/mail/emails/NewUser.tsx
Normal file
58
packages/mail/emails/NewUser.tsx
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { Link, Text } from "@react-email/components";
|
||||
import React from "react";
|
||||
import { createTranslator } from "use-intl/core";
|
||||
import PrimaryButton from "../src/components/PrimaryButton";
|
||||
import Wrapper from "../src/components/Wrapper";
|
||||
import { defaultTranslations } from "../src/util/translations";
|
||||
import { defaultLocale } from "../src/util/translations";
|
||||
import type { BaseMailProps } from "../types";
|
||||
|
||||
export function NewUser({
|
||||
url,
|
||||
name,
|
||||
otp,
|
||||
locale,
|
||||
translations,
|
||||
}: {
|
||||
url: string;
|
||||
name: string;
|
||||
otp: string;
|
||||
} & BaseMailProps) {
|
||||
const t = createTranslator({
|
||||
locale,
|
||||
messages: translations,
|
||||
});
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Text>{t("mail.newUser.body", { name })}</Text>
|
||||
|
||||
<Text>
|
||||
{t("mail.common.otp")}
|
||||
<br />
|
||||
<strong className="font-bold text-2xl">{otp}</strong>
|
||||
</Text>
|
||||
|
||||
<Text>{t("mail.common.useLink")}</Text>
|
||||
|
||||
<PrimaryButton href={url}>
|
||||
{t("mail.newUser.confirmEmail")} →
|
||||
</PrimaryButton>
|
||||
|
||||
<Text className="text-muted-foreground text-sm">
|
||||
{t("mail.common.openLinkInBrowser")}
|
||||
<Link href={url}>{url}</Link>
|
||||
</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
NewUser.PreviewProps = {
|
||||
locale: defaultLocale,
|
||||
translations: defaultTranslations,
|
||||
url: "#",
|
||||
name: "John Doe",
|
||||
otp: "123456",
|
||||
};
|
||||
|
||||
export default NewUser;
|
||||
30
packages/mail/emails/NewsletterSignup.tsx
Normal file
30
packages/mail/emails/NewsletterSignup.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { Heading, Text } from "@react-email/components";
|
||||
import React from "react";
|
||||
import { createTranslator } from "use-intl/core";
|
||||
import Wrapper from "../src/components/Wrapper";
|
||||
import { defaultTranslations } from "../src/util/translations";
|
||||
import { defaultLocale } from "../src/util/translations";
|
||||
import type { BaseMailProps } from "../types";
|
||||
|
||||
export function NewsletterSignup({ locale, translations }: BaseMailProps) {
|
||||
const t = createTranslator({
|
||||
locale,
|
||||
messages: translations,
|
||||
});
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Heading className="text-xl">
|
||||
{t("mail.newsletterSignup.subject")}
|
||||
</Heading>
|
||||
<Text>{t("mail.newsletterSignup.body")}</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
NewsletterSignup.PreviewProps = {
|
||||
locale: defaultLocale,
|
||||
translations: defaultTranslations,
|
||||
};
|
||||
|
||||
export default NewsletterSignup;
|
||||
55
packages/mail/emails/OrganizationInvitation.tsx
Normal file
55
packages/mail/emails/OrganizationInvitation.tsx
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { Heading, Link, Text } from "@react-email/components";
|
||||
import React from "react";
|
||||
import { createTranslator } from "use-intl/core";
|
||||
import PrimaryButton from "../src/components/PrimaryButton";
|
||||
import Wrapper from "../src/components/Wrapper";
|
||||
import { defaultLocale } from "../src/util/translations";
|
||||
import { defaultTranslations } from "../src/util/translations";
|
||||
import type { BaseMailProps } from "../types";
|
||||
|
||||
export function OrganizationInvitation({
|
||||
url,
|
||||
organizationName,
|
||||
locale,
|
||||
translations,
|
||||
}: {
|
||||
url: string;
|
||||
organizationName: string;
|
||||
} & BaseMailProps) {
|
||||
const t = createTranslator({
|
||||
locale,
|
||||
messages: translations,
|
||||
});
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Heading className="text-xl">
|
||||
{t.markup("mail.organizationInvitation.headline", {
|
||||
organizationName,
|
||||
strong: (chunks) => `<strong>${chunks}</strong>`,
|
||||
})}
|
||||
</Heading>
|
||||
<Text>
|
||||
{t("mail.organizationInvitation.body", { organizationName })}
|
||||
</Text>
|
||||
|
||||
<PrimaryButton href={url}>
|
||||
{t("mail.organizationInvitation.join")}
|
||||
</PrimaryButton>
|
||||
|
||||
<Text className="mt-4 text-muted-foreground text-sm">
|
||||
{t("mail.common.openLinkInBrowser")}
|
||||
<Link href={url}>{url}</Link>
|
||||
</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
OrganizationInvitation.PreviewProps = {
|
||||
locale: defaultLocale,
|
||||
translations: defaultTranslations,
|
||||
url: "#",
|
||||
organizationName: "Acme",
|
||||
};
|
||||
|
||||
export default OrganizationInvitation;
|
||||
15
packages/mail/emails/index.ts
Normal file
15
packages/mail/emails/index.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { EmailVerification } from "../emails/EmailVerification";
|
||||
import { ForgotPassword } from "../emails/ForgotPassword";
|
||||
import { MagicLink } from "../emails/MagicLink";
|
||||
import { NewUser } from "../emails/NewUser";
|
||||
import { NewsletterSignup } from "../emails/NewsletterSignup";
|
||||
import { OrganizationInvitation } from "../emails/OrganizationInvitation";
|
||||
|
||||
export const mailTemplates = {
|
||||
magicLink: MagicLink,
|
||||
forgotPassword: ForgotPassword,
|
||||
newUser: NewUser,
|
||||
newsletterSignup: NewsletterSignup,
|
||||
organizationInvitation: OrganizationInvitation,
|
||||
emailVerification: EmailVerification,
|
||||
} as const;
|
||||
Loading…
Add table
Add a link
Reference in a new issue