import {Heading, Text, Section, Button} from "@react-email/components"; import {getServerUrl} from "@/utils/get-server-url"; import EmailLayout from "@/components/emails/email-layout"; interface EmailCreateUserProps { firstname?: string; oldEmail?: string; newEmail?: string; url: string; } export const EmailVerification = ({firstname, oldEmail, newEmail, url: urlVerification}: EmailCreateUserProps) => { const serverUrl = new URL(getServerUrl()); const url = new URL(urlVerification); url.hostname = serverUrl.hostname; url.port = serverUrl.port == "80" ? "" : serverUrl.port; const newUrl = url.toString(); return ( Hello {firstname}, We received a request to change the email address associated with your account. If you did not request this change, please ignore this email. Your current email address will remain unchanged. If this seems suspicious, contact your administrator. {oldEmail && newEmail ? ( Old email address: {oldEmail}
New email address: {newEmail}
) : null}
); }; export default EmailVerification;