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) => {
|
2024-12-31 18:25:11 -05:00
|
|
|
|
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>
|
2024-12-30 23:41:06 -05:00
|
|
|
|
|
2025-01-04 20:22:01 -05:00
|
|
|
|
<EmailText>
|
2024-11-03 17:28:12 -05:00
|
|
|
|
You’ve been invited to join the organization{" "}
|
2025-01-04 20:22:01 -05:00
|
|
|
|
<strong>{orgName}</strong>
|
2024-11-08 00:03:54 -05:00
|
|
|
|
{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>
|
2024-11-08 00:03:54 -05:00
|
|
|
|
{expiresInDays}{" "}
|
|
|
|
|
{expiresInDays === "1" ? "day" : "days"}.
|
2025-01-04 20:22:01 -05:00
|
|
|
|
</strong>
|
|
|
|
|
</EmailText>
|
|
|
|
|
|
|
|
|
|
<EmailSection>
|
|
|
|
|
<ButtonLink href={inviteLink}>
|
2024-12-30 23:41:06 -05:00
|
|
|
|
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;
|