-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MS-670] feat: Clean templates props types
- Loading branch information
1 parent
b321e4e
commit 468c5b7
Showing
18 changed files
with
125 additions
and
54 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
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,39 @@ | ||
import { type z } from "zod"; | ||
|
||
import { type CUSTOM_EVENTS_SCHEMA } from "@/const"; | ||
import Header from "@/emails/components/Header"; | ||
import Layout from "@/emails/components/Layout"; | ||
import Text from "@/emails/components/Text"; | ||
import { type CustomEventData } from "@/lib/types"; | ||
|
||
type CustomEventEmailProps = CustomEventData< | ||
z.infer<(typeof CUSTOM_EVENTS_SCHEMA)["custom_event"]> | ||
>; | ||
|
||
const CustomEventEmail = ({ | ||
data: { channel, email, name }, | ||
}: CustomEventEmailProps) => { | ||
return ( | ||
<Layout channel={channel} previewText="Custom event"> | ||
{() => ( | ||
<> | ||
<Header>Hi {name}!</Header> | ||
<Text>This is a custom email event sent by the Mirumee team.</Text> | ||
</> | ||
)} | ||
</Layout> | ||
); | ||
}; | ||
|
||
const previewProps: CustomEventEmailProps = { | ||
data: { | ||
name: "Name", | ||
email: "user@example.com", | ||
channel: "channel-us", | ||
}, | ||
}; | ||
|
||
CustomEventEmail.PreviewProps = previewProps; | ||
CustomEventEmail.Subject = "Custom event"; | ||
|
||
export default CustomEventEmail; |
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
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
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
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
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
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
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
Oops, something went wrong.