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

87 lines
2.8 KiB
TypeScript
Raw Normal View History

2025-07-13 21:57:24 -07:00
import React from "react";
import { Body, Head, Html, Preview, Tailwind } from "@react-email/components";
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}>
2025-07-13 21:57:24 -07:00
<Body className="font-sans bg-gray-50">
2025-01-04 20:22:01 -05:00
<EmailContainer>
<EmailLetterHead />
2025-07-13 21:57:24 -07:00
{/* <EmailHeading> */}
{/* You're Invited to Join {orgName} */}
{/* </EmailHeading> */}
2025-01-04 20:22:01 -05:00
2025-07-13 21:57:24 -07:00
<EmailGreeting>Hi there,</EmailGreeting>
2025-01-04 20:22:01 -05:00
<EmailText>
2025-07-13 21:57:24 -07:00
You've been invited to join{" "}
2025-01-04 20:22:01 -05:00
<strong>{orgName}</strong>
2025-07-13 21:57:24 -07:00
{inviterName ? ` by ${inviterName}` : ""}. Click the
button below to accept your invitation and get
started.
2025-01-04 20:22:01 -05:00
</EmailText>
<EmailSection>
<ButtonLink href={inviteLink}>
2025-07-13 21:57:24 -07:00
Accept Invitation
2025-01-04 20:22:01 -05:00
</ButtonLink>
</EmailSection>
2024-12-22 17:27:09 -05:00
2025-07-13 21:57:24 -07:00
{/* <EmailText> */}
{/* If you're having trouble clicking the button, copy */}
{/* and paste the URL below into your web browser: */}
{/* <br /> */}
{/* <span className="break-all">{inviteLink}</span> */}
{/* </EmailText> */}
<EmailText>
This invite expires in {expiresInDays}{" "}
{expiresInDays === "1" ? "day" : "days"}. If the
link has expired, please contact the owner of the
organization to request a new invitation.
</EmailText>
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;