mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-25 20:27:44 +02:00
✨ Skip user details step for logged in users (#602)
This commit is contained in:
parent
f858bcc5f4
commit
d8e3dcd357
41 changed files with 548 additions and 636 deletions
|
@ -13,7 +13,7 @@ import {
|
|||
} from "@react-email/components";
|
||||
import { Tailwind } from "@react-email/tailwind";
|
||||
|
||||
import { SmallText, Text } from "./styled-components";
|
||||
import { Text } from "./styled-components";
|
||||
|
||||
interface EmailLayoutProps {
|
||||
preview: string;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { EmailLayout } from "./email-layout";
|
||||
import { Button, Card, Link, Text } from "./styled-components";
|
||||
import { Button, Link, Text } from "./styled-components";
|
||||
import { getDomain } from "./utils";
|
||||
|
||||
export interface NotificationBaseProps {
|
||||
name: string;
|
||||
title: string;
|
||||
pollUrl: string;
|
||||
unsubscribeUrl: string;
|
||||
disableNotificationsUrl: string;
|
||||
}
|
||||
|
||||
export interface NotificationEmailProps extends NotificationBaseProps {
|
||||
|
@ -16,7 +16,7 @@ export interface NotificationEmailProps extends NotificationBaseProps {
|
|||
export const NotificationEmail = ({
|
||||
name,
|
||||
pollUrl,
|
||||
unsubscribeUrl,
|
||||
disableNotificationsUrl,
|
||||
preview,
|
||||
children,
|
||||
}: React.PropsWithChildren<NotificationEmailProps>) => {
|
||||
|
@ -26,7 +26,7 @@ export const NotificationEmail = ({
|
|||
footNote={
|
||||
<>
|
||||
If you would like to stop receiving updates you can{" "}
|
||||
<Link className="whitespace-nowrap" href={unsubscribeUrl}>
|
||||
<Link className="whitespace-nowrap" href={disableNotificationsUrl}>
|
||||
turn notifications off
|
||||
</Link>
|
||||
</>
|
||||
|
|
|
@ -12,14 +12,14 @@ export const NewCommentEmail = ({
|
|||
title = "Untitled Poll",
|
||||
authorName = "Someone",
|
||||
pollUrl = "https://rallly.co",
|
||||
unsubscribeUrl = "https://rallly.co",
|
||||
disableNotificationsUrl = "https://rallly.co",
|
||||
}: NewCommentEmailProps) => {
|
||||
return (
|
||||
<NotificationEmail
|
||||
name={name}
|
||||
title={title}
|
||||
pollUrl={pollUrl}
|
||||
unsubscribeUrl={unsubscribeUrl}
|
||||
disableNotificationsUrl={disableNotificationsUrl}
|
||||
preview={`${authorName} has commented on ${title}`}
|
||||
>
|
||||
<Text>
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
import { EmailLayout } from "./components/email-layout";
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Domain,
|
||||
Heading,
|
||||
Section,
|
||||
Text,
|
||||
} from "./components/styled-components";
|
||||
import { Button, Domain, Section, Text } from "./components/styled-components";
|
||||
import { getDomain } from "./components/utils";
|
||||
|
||||
interface NewParticipantConfirmationEmailProps {
|
||||
|
|
|
@ -12,14 +12,14 @@ export const NewParticipantEmail = ({
|
|||
title = "Untitled Poll",
|
||||
participantName = "Someone",
|
||||
pollUrl = "https://rallly.co",
|
||||
unsubscribeUrl = "https://rallly.co",
|
||||
disableNotificationsUrl = "https://rallly.co",
|
||||
}: NewParticipantEmailProps) => {
|
||||
return (
|
||||
<NotificationEmail
|
||||
name={name}
|
||||
title={title}
|
||||
pollUrl={pollUrl}
|
||||
unsubscribeUrl={unsubscribeUrl}
|
||||
disableNotificationsUrl={disableNotificationsUrl}
|
||||
preview={`${participantName} has responded`}
|
||||
>
|
||||
<Text>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { absoluteUrl, preventWidows } from "@rallly/utils";
|
||||
import { absoluteUrl } from "@rallly/utils";
|
||||
|
||||
import { EmailLayout } from "./components/email-layout";
|
||||
import {
|
||||
|
@ -6,7 +6,6 @@ import {
|
|||
Card,
|
||||
Heading,
|
||||
Link,
|
||||
Section,
|
||||
SubHeadingText,
|
||||
Text,
|
||||
} from "./components/styled-components";
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
import { EmailLayout } from "./components/email-layout";
|
||||
import { Button, Link, Section, Text } from "./components/styled-components";
|
||||
|
||||
type EnableNotificationsEmailProps = {
|
||||
title: string;
|
||||
name: string;
|
||||
verificationLink: string;
|
||||
adminLink: string;
|
||||
};
|
||||
|
||||
export const EnableNotificationsEmail = ({
|
||||
title = "Untitled Poll",
|
||||
name = "John",
|
||||
verificationLink = "https://rallly.co",
|
||||
adminLink = "https://rallly.co",
|
||||
}: EnableNotificationsEmailProps) => {
|
||||
return (
|
||||
<EmailLayout
|
||||
recipientName={name}
|
||||
preview="We need to verify your email address"
|
||||
footNote={
|
||||
<>
|
||||
You are receiving this email because a request was made to enable
|
||||
notifications for <Link href={adminLink}>{title}</Link>.
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Text>
|
||||
Would you like to get notified when participants respond to{" "}
|
||||
<strong>{title}</strong>?
|
||||
</Text>
|
||||
<Section>
|
||||
<Button href={verificationLink} id="verifyEmailUrl">
|
||||
Yes, enable notifications
|
||||
</Button>
|
||||
</Section>
|
||||
<Text light={true}>The link will expire in 15 minutes.</Text>
|
||||
</EmailLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default EnableNotificationsEmail;
|
Loading…
Add table
Add a link
Reference in a new issue