-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#67 send email to peeps when unregister
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import type { Event } from '@prisma/client' | ||
import { Container, Html, Tailwind, Text } from '@react-email/components' | ||
import tailwindConfig from '~/../tailwind.config.ts' | ||
import { format } from 'date-fns' | ||
import { volunteerTypes } from '~/data.ts' | ||
|
||
export function UnregistrationEmail({ | ||
event, | ||
role, | ||
}: { | ||
event: Event | ||
role: 'cleaningCrew' | 'lessonAssistants' | 'sideWalkers' | 'horseLeaders' | ||
}) { | ||
let roleName | ||
for (let v of volunteerTypes) { | ||
if (v.field == role) { | ||
roleName = v.displayName | ||
} | ||
} | ||
|
||
return ( | ||
<Tailwind config={tailwindConfig}> | ||
<Html lang="en" dir="ltr"> | ||
<Container> | ||
<h1> | ||
<Text>Thanks for considering volunteering! We hope to see you again!</Text> | ||
</h1> | ||
<p> | ||
<Text> | ||
You've unregistered to volunteer{' '} | ||
{roleName ? `as one of the ${roleName}` : ''} to help with the | ||
following event: | ||
</Text> | ||
<Text>{event.title}</Text> | ||
<Text>On: {format(event.start, 'MMMM do, y')}</Text> | ||
<Text> | ||
From: {format(event.start, 'p')} - {format(event.end, 'p')} | ||
</Text> | ||
</p> | ||
</Container> | ||
</Html> | ||
</Tailwind> | ||
) | ||
} |