diff --git a/backend/email/emails/functions/send-email.ts b/backend/email/emails/functions/send-email.ts index 413eec07..ad5b8944 100644 --- a/backend/email/emails/functions/send-email.ts +++ b/backend/email/emails/functions/send-email.ts @@ -1,6 +1,6 @@ +import {sleep} from 'common/util/time' import {type CreateEmailOptions, CreateEmailRequestOptions, Resend} from 'resend' import {log} from 'shared/utils' -import {sleep} from 'common/util/time' /* * typically: { subject: string, to: string | string[] } & ({ text: string } | { react: ReactNode }) diff --git a/backend/email/emails/new-endorsement.tsx b/backend/email/emails/new-endorsement.tsx index 922e2aba..767425d9 100644 --- a/backend/email/emails/new-endorsement.tsx +++ b/backend/email/emails/new-endorsement.tsx @@ -1,4 +1,3 @@ -import React from 'react' import { Body, Button, @@ -11,12 +10,14 @@ import { Section, Text, } from '@react-email/components' -import {type User} from 'common/user' import {DOMAIN} from 'common/envs/constants' -import {jamesUser, mockUser} from './functions/mock' +import {type User} from 'common/user' import {button, container, content, Footer, main, paragraph} from 'email/utils' +import React from 'react' import {createT} from 'shared/locale' +import {jamesUser, mockUser} from './functions/mock' + interface NewEndorsementEmailProps { fromUser: User onUser: User @@ -42,7 +43,11 @@ export const NewEndorsementEmail = ({ return ( - {t('email.new_endorsement.preview', 'New endorsement from {fromUserName}', {fromUserName: fromUser.name})} + + {t('email.new_endorsement.preview', 'New endorsement from {fromUserName}', { + fromUserName: fromUser.name, + })} + {/*
*/} @@ -55,9 +60,15 @@ export const NewEndorsementEmail = ({ {/*
*/}
- {t('email.new_endorsement.greeting', 'Hi {name},', {name})} + + {t('email.new_endorsement.greeting', 'Hi {name},', {name})} + - {t('email.new_endorsement.message', '{fromUserName} endorsed you!', {fromUserName: fromUser.name})} + + {t('email.new_endorsement.message', '{fromUserName} endorsed you!', { + fromUserName: fromUser.name, + })} +
diff --git a/backend/email/emails/new-match.tsx b/backend/email/emails/new-match.tsx index df868306..a3d54314 100644 --- a/backend/email/emails/new-match.tsx +++ b/backend/email/emails/new-match.tsx @@ -1,10 +1,11 @@ -import React from 'react' import {Body, Button, Container, Head, Html, Preview, Section, Text} from '@react-email/components' import {DOMAIN} from 'common/envs/constants' import {type ProfileRow} from 'common/profiles/profile' import {type User} from 'common/user' -import {jamesProfile, jamesUser, mockUser} from './functions/mock' import {Footer} from 'email/utils' +import React from 'react' + +import {jamesProfile, jamesUser, mockUser} from './functions/mock' interface NewMatchEmailProps { onUser: User diff --git a/backend/email/emails/new-message.tsx b/backend/email/emails/new-message.tsx index 580033bc..9181dc17 100644 --- a/backend/email/emails/new-message.tsx +++ b/backend/email/emails/new-message.tsx @@ -1,12 +1,13 @@ -import React from 'react' import {Body, Button, Container, Head, Html, Preview, Section, Text} from '@react-email/components' -import {type User} from 'common/user' -import {type ProfileRow} from 'common/profiles/profile' -import {jamesProfile, jamesUser, mockUser} from './functions/mock' import {DOMAIN} from 'common/envs/constants' +import {type ProfileRow} from 'common/profiles/profile' +import {type User} from 'common/user' import {button, container, content, Footer, imageContainer, main, paragraph} from 'email/utils' +import React from 'react' import {createT} from 'shared/locale' +import {jamesProfile, jamesUser, mockUser} from './functions/mock' + interface NewMessageEmailProps { fromUser: User fromUserProfile: ProfileRow diff --git a/backend/email/emails/new-search_alerts.tsx b/backend/email/emails/new-search_alerts.tsx index 3709d591..efedb529 100644 --- a/backend/email/emails/new-search_alerts.tsx +++ b/backend/email/emails/new-search_alerts.tsx @@ -1,14 +1,15 @@ -import React from 'react' import {Body, Container, Head, Html, Link, Preview, Section, Text} from '@react-email/components' -import {type User} from 'common/user' -import {mockUser} from './functions/mock' import {DOMAIN} from 'common/envs/constants' -import {container, content, Footer, main, paragraph} from 'email/utils' +import {FilterFields} from 'common/filters' import {MatchesType} from 'common/profiles/bookmarked_searches' import {formatFilters, locationType} from 'common/searches' -import {FilterFields} from 'common/filters' +import {type User} from 'common/user' +import {container, content, Footer, main, paragraph} from 'email/utils' +import React from 'react' import {createT} from 'shared/locale' +import {mockUser} from './functions/mock' + interface NewMessageEmailProps { toUser: User matches: MatchesType[] diff --git a/backend/email/emails/utils.tsx b/backend/email/emails/utils.tsx index 75d3d7a4..b9a5f198 100644 --- a/backend/email/emails/utils.tsx +++ b/backend/email/emails/utils.tsx @@ -1,6 +1,6 @@ -import React from 'react' import {Column, Img, Link, Row, Section, Text} from '@react-email/components' import {DOMAIN} from 'common/envs/constants' +import React from 'react' import {createT} from 'shared/locale' interface Props { @@ -61,7 +61,11 @@ export const Footer = ({email, unsubscribeUrl, locale}: Props) => { - {t('email.footer.sent_to', 'The email was sent to {email}. To no longer receive these emails, unsubscribe', {email})}{' '} + {t( + 'email.footer.sent_to', + 'The email was sent to {email}. To no longer receive these emails, unsubscribe', + {email}, + )}{' '} {t('email.footer.unsubscribe_link', 'here')}. diff --git a/backend/email/emails/welcome.tsx b/backend/email/emails/welcome.tsx index 3e89f3c6..242568cd 100644 --- a/backend/email/emails/welcome.tsx +++ b/backend/email/emails/welcome.tsx @@ -1,10 +1,11 @@ -import React from 'react' import {Body, Button, Container, Head, Html, Preview, Section, Text} from '@react-email/components' import {type User} from 'common/user' -import {mockUser} from './functions/mock' import {button, container, content, Footer, main, paragraph} from 'email/utils' +import React from 'react' import {createT} from 'shared/locale' +import {mockUser} from './functions/mock' + interface WelcomeEmailProps { toUser: User unsubscribeUrl: string @@ -26,15 +27,29 @@ export const WelcomeEmail = ({ return ( - {t('email.welcome.preview', 'Welcome to Compass — Please confirm your email')} + + {t('email.welcome.preview', 'Welcome to Compass — Please confirm your email')} +
- {t('email.welcome.title', 'Welcome to Compass, {name}!', {name})} + + {t('email.welcome.title', 'Welcome to Compass, {name}!', {name})} + - {t('email.welcome.intro', 'Compass is a free, community-owned platform built to help people form deep, meaningful connections — platonic, romantic, or collaborative. There are no ads, no hidden algorithms, and no subscriptions — just a transparent, open-source space shaped by people like you.')} + + {t( + 'email.welcome.intro', + 'Compass is a free, community-owned platform built to help people form deep, meaningful connections — platonic, romantic, or collaborative. There are no ads, no hidden algorithms, and no subscriptions — just a transparent, open-source space shaped by people like you.', + )} + - {t('email.welcome.confirmation', 'To finish creating your account and start exploring Compass, please confirm your email below:')} + + {t( + 'email.welcome.confirmation', + 'To finish creating your account and start exploring Compass, please confirm your email below:', + )} +