import * as React from "react"; import env from "@server/env"; import BaseEmail, { EmailMessageCategory, EmailProps } from "./BaseEmail"; import Body from "./components/Body"; import Button from "./components/Button"; import EmailTemplate from "./components/EmailLayout"; import EmptySpace from "./components/EmptySpace"; import Footer from "./components/Footer"; import Header from "./components/Header"; import Heading from "./components/Heading"; type Props = EmailProps & { code: string; previous: string | null; teamUrl: string; }; /** * Email sent to a user when they request to change their email. */ export default class ConfirmUpdateEmail extends BaseEmail { protected get category() { return EmailMessageCategory.Authentication; } protected subject() { return `Your email update request`; } protected preview() { return `Here’s your email change confirmation.`; } protected renderAsText({ teamUrl, code, previous, to }: Props): string { return ` You requested to update your ${env.APP_NAME} account email. Please follow the link below to confirm the change ${ previous ? `from ${previous} ` : "" }to ${to}. ${this.updateLink(teamUrl, code)} `; } protected render({ teamUrl, code, previous, to }: Props) { return (
Your email update request

You requested to update your {env.APP_NAME} account email. Please click below to confirm the change{" "} {previous ? `from ${previous} ` : ""}to {to}.