fosrl.pangolin/server/emails/templates/SendInviteLink.tsx

84 lines
2.3 KiB
TypeScript
Raw Normal View History

2024-11-03 17:28:12 -05:00
import {
Body,
Head,
Html,
Preview,
Tailwind,
} from "@react-email/components";
import * as React from "react";
2025-01-04 20:22:01 -05:00
import { themeColors } from "./lib/theme";
import {
EmailContainer,
EmailFooter,
EmailGreeting,
EmailHeading,
EmailLetterHead,
EmailSection,
2025-01-05 00:06:24 -05:00
EmailSignature,
2025-01-04 20:22:01 -05:00
EmailText
} from "./components/Email";
import ButtonLink from "./components/ButtonLink";
2024-11-03 17:28:12 -05:00
interface SendInviteLinkProps {
email: string;
inviteLink: string;
orgName: string;
inviterName?: string;
expiresInDays: string;
}
export const SendInviteLink = ({
email,
inviteLink,
orgName,
inviterName,
2024-12-22 17:27:09 -05:00
expiresInDays
2024-11-03 17:28:12 -05:00
}: SendInviteLinkProps) => {
const previewText = `${inviterName} invited you to join ${orgName}`;
2024-11-03 17:28:12 -05:00
return (
<Html>
<Head />
<Preview>{previewText}</Preview>
2025-01-04 20:22:01 -05:00
<Tailwind config={themeColors}>
2024-11-03 17:28:12 -05:00
<Body className="font-sans">
2025-01-04 20:22:01 -05:00
<EmailContainer>
<EmailLetterHead />
<EmailHeading>Invited to Join {orgName}</EmailHeading>
<EmailGreeting>Hi {email || "there"},</EmailGreeting>
2025-01-04 20:22:01 -05:00
<EmailText>
2024-11-03 17:28:12 -05:00
Youve been invited to join the organization{" "}
2025-01-04 20:22:01 -05:00
<strong>{orgName}</strong>
{inviterName ? ` by ${inviterName}.` : "."} Please
2024-11-03 17:28:12 -05:00
access the link below to accept the invite.
2025-01-04 20:22:01 -05:00
</EmailText>
<EmailText>
2024-11-03 17:28:12 -05:00
This invite will expire in{" "}
2025-01-04 20:22:01 -05:00
<strong>
{expiresInDays}{" "}
{expiresInDays === "1" ? "day" : "days"}.
2025-01-04 20:22:01 -05:00
</strong>
</EmailText>
<EmailSection>
<ButtonLink href={inviteLink}>
Accept Invite to {orgName}
2025-01-04 20:22:01 -05:00
</ButtonLink>
</EmailSection>
2024-12-22 17:27:09 -05:00
2025-01-04 20:22:01 -05:00
<EmailFooter>
2025-01-05 00:06:24 -05:00
<EmailSignature />
2025-01-04 20:22:01 -05:00
</EmailFooter>
</EmailContainer>
2024-11-03 17:28:12 -05:00
</Body>
</Tailwind>
</Html>
);
};
export default SendInviteLink;