Raw
1 export const metadata = {
2 title: `Set Up React Email Templates for Cloud Projects`,
3 }
4
5 # {metadata.title}
6
7 In this guide, you'll learn how to set up React Email templates for [sending emails in Cloud projects](../page.mdx).
8
9 ## What is React Email?
10
11 [React Email](https://react.email) is a library that allows you to create email templates using React components. You can then transform these templates into HTML strings for sending emails.
12
13 React Email also allows you to preview and test your email templates during development.
14
15 In this guide, you'll learn how to:
16
17 - Install React Email dependencies in your Medusa project.
18 - Create an invite user email template using React Email.
19 - Preview email templates during development.
20 - Send emails using the React Email template with Medusa Emails.
21
22 You'll also find examples of common email templates built with React Email at the end of this guide.
23
24 <Note>
25
26 Medusa Emails is available for all Cloud organizations and projects, given you [don't have another Notification Module Provider for the `email` channel configured](../page.mdx#remove-other-email-notification-module-providers). You also optionally need to [verify your sending domain](../page.mdx#add-email-sender-domain-to-cloud) to send emails to users outside your organization. Verified sender domains are available for Launch, Scale, and Enterprise plans only.
27
28 </Note>
29
30 ---
31
32 ## Step 1: Install React Email Dependencies
33
34 In the Medusa project where you want to set up email templates, install the following dependencies:
35
36 ```bash npm2yarn
37 npm install @react-email/components@0.3.3 @react-email/render@1.1.4
38 npm install -D @react-email/preview-server@4.2.5 react-email@4.2.5
39 ```
40
41 These packages include:
42
43 - `@react-email/components`: Provides pre-built React components for building email templates.
44 - `@react-email/render`: Renders React Email templates to HTML strings.
45 - `@react-email/preview-server` and `react-email`: Development dependencies for previewing and testing email templates.
46
47 <Note>
48
49 Newer versions of React Email are not supported due to Node version incompatibilities on Cloud.
50
51 </Note>
52
53 <Note title="Warning" type="warning">
54
55 If your Cloud deployment fails with `Cannot find module 'react/jsx-runtime'`, it means `react` and `react-dom` are not available at runtime. Cloud does not install `devDependencies` during deployment, so these packages must be in the `dependencies` section of your `package.json`.
56
57 To fix this, install them as production dependencies:
58
59 ```bash npm2yarn
60 npm install react react-dom
61 ```
62
63 </Note>
64
65 ---
66
67 ## Step 2: Create Invite User Email Template
68
69 Next, create the `src/emails` directory to store your email templates in your Medusa project.
70
71 Then, create your email templates as React components in that directory.
72
73 For example, to create an email template for sending invites to new admin users, create the file `src/emails/invite-user.tsx` with the following content:
74
75 ```tsx title="src/emails/invite-user.tsx"
76 import {
77 Text,
78 Container,
79 Heading,
80 Html,
81 Section,
82 Tailwind,
83 Head,
84 Preview,
85 Body,
86 Button,
87 } from "@react-email/components"
88
89 type InviteEmailProps = {
90 inviteUrl: string
91 storeName: string
92 }
93
94 function Template({ inviteUrl, storeName }: InviteEmailProps) {
95 return (
96 <Tailwind>
97 <Html className="font-sans bg-gray-100">
98 <Head />
99 <Preview>{`You've been invited to join ${storeName ?? ""}`}</Preview>
100 <Body className="bg-white my-10 mx-auto w-full max-w-2xl">
101 {/* Main Content */}
102 <Container className="p-6 text-center">
103 <Heading className="text-lg font-semibold text-black mb-6">
104 You've been invited to join {storeName ?? ""}
105 </Heading>
106
107 <Text className="text-sm text-black leading-relaxed mb-6">
108 Click the button below to accept the invitation and get started.
109 </Text>
110
111 <Section className="text-center my-8">
112 <Button
113 href={inviteUrl}
114 className="bg-black text-white py-3 px-8 inline-block"
115 >
116 Accept invitation
117 </Button>
118 </Section>
119 </Container>
120
121 {/* Footer */}
122 <Section className="bg-gray-50 p-6 mt-10">
123 <Text className="text-center text-black text-xs mt-4">
124 © {new Date().getFullYear()} {storeName}, Inc. All rights reserved.
125 </Text>
126 </Section>
127 </Body>
128 </Html>
129 </Tailwind>
130 )
131 }
132
133 export default function getInviteTemplate(props?: InviteEmailProps) {
134 return (
135 <Template
136 inviteUrl={props?.inviteUrl ?? "#"}
137 storeName={props?.storeName ?? "Demo Store"}
138 />
139 )
140 }
141 ```
142
143 In the file, you define:
144
145 - A React component `Template` that uses React Email components to structure the email.
146 - A default export function `getInviteTemplate` that returns the `Template` component with default props.
147
148 The file must export a function that returns a React component representing the email template. React Email uses this function to preview the email, and you'll use it later to render the template to HTML.
149
150 ---
151
152 ## Step 3: Preview Email Template (Optional)
153
154 It's useful to preview your email templates during development to ensure they look as expected. This allows you to catch any design issues or mistakes early.
155
156 To preview your email template, use the React Email Preview Server.
157
158 First, add the following script to the `scripts` section of your `package.json`:
159
160 ```json
161 {
162 "scripts": {
163 "preview:emails": "email dev --dir ./src/emails"
164 }
165 }
166 ```
167
168 This script uses the `email dev` command from `react-email`, specifying the directory where your email templates are located.
169
170 Then, run the preview server with the following command:
171
172 ```bash npm2yarn
173 npm run preview:emails
174 ```
175
176 The preview server will start at `http://localhost:3000`, where you can view and test your email templates in the browser.
177
178 ---
179
180 ## Step 4: Send Email Using Template
181
182 Once you have the email template, you can use it to send emails from your Medusa project deployed on Cloud.
183
184 For example, to send an invite email when a new admin user is invited, create a [subscriber](!docs!/learn/fundamentals/events-and-subscribers) with the following content:
185
186 ```ts title="src/subscribers/invite-admin-subscriber.ts"
187 import type {
188 SubscriberArgs,
189 SubscriberConfig,
190 } from "@medusajs/framework"
191 import { render, pretty } from "@react-email/render"
192 import getInviteTemplate from "../emails/invite-user"
193 import {
194 Modules,
195 ContainerRegistrationKeys,
196 } from "@medusajs/framework/utils"
197
198 export default async function inviteCreatedHandler({
199 event: { data },
200 container,
201 }: SubscriberArgs<{ id: string }>) {
202 const query = container.resolve(
203 ContainerRegistrationKeys.QUERY
204 )
205
206 const {
207 data: [store],
208 } = await query.graph({
209 entity: "store",
210 fields: ["name"],
211 })
212
213 const {
214 data: [invite],
215 } = await query.graph({
216 entity: "invite",
217 fields: ["email", "token"],
218 filters: {
219 id: data.id,
220 },
221 })
222
223 const config = container.resolve(
224 ContainerRegistrationKeys.CONFIG_MODULE
225 )
226
227 const adminPath = config.admin.path
228
229 const inviteUrl = `/${adminPath}/invite?token=${invite.token}`
230
231 const notificationModule = container.resolve(
232 Modules.NOTIFICATION
233 )
234
235 const html = await pretty(
236 await render(getInviteTemplate({
237 inviteUrl,
238 storeName: store.name,
239 }))
240 )
241
242 await notificationModule.createNotifications({
243 to: invite.email,
244 // optional: set from email
245 // from: "no-reply@yourdomain.com"
246 channel: "email",
247 content: {
248 html,
249 subject: `You've been invited to join ${store.name}`,
250 },
251 })
252 }
253
254 export const config: SubscriberConfig = {
255 event: [
256 "invite.created",
257 "invite.resent",
258 ],
259 }
260 ```
261
262 This subscriber listens for the `invite.created` and `invite.resent` events. When triggered, it:
263
264 1. Retrieves the store name and invite details.
265 2. Constructs the invite URL. Invites to the admin dashboard are at the `/admin/invite` path and include the invite token as a `token` query parameter.
266 3. Renders the invite email template to an HTML string using React Email's `render` function, passing the `getInviteTemplate` function with the invite URL and store name as props.
267 4. Sends the email by creating a notification using Medusa's Notification Module.
268
269 ---
270
271 ## Test Email Sending on Cloud
272
273 To test that your emails are sent correctly on Cloud, make sure you've pushed all changes to the project's repository, and the changes have been deployed to your Cloud project.
274
275 Then, [invite a new admin user](!user-guide!/settings/users/invites) to your Cloud project through the Medusa Admin dashboard.
276
277 If everything is set up correctly, the new admin user should receive the invite email using your React Email template.
278
279 Otherwise, refer to the [Troubleshooting Medusa Emails on Cloud](../page.mdx#troubleshoot-email-delivery-issues-on-cloud) guide for help resolving common issues.
280
281 ---
282
283 ## Common Email Templates
284
285 This section provides examples of common email templates you can create using React Email, then send in your Cloud projects. You can customize these templates to fit your brand and use case.
286
287 You can also refer to the [React Email documentation](https://react.email/docs) for more information on building email templates with React Email.
288
289 ### Order Placed Email Template
290
291 The Order Placed email template notifies customers when they successfully place an order. It typically includes order details, shipping information, and a thank-you message.
292
293 You can use the following template for your Order Placed email:
294
295 ```tsx title="src/emails/order-placed.tsx" collapsibleLines="36-257"
296 import { CustomerDTO, OrderDTO } from "@medusajs/framework/types"
297 import {
298 Body,
299 Column,
300 Container,
301 Head,
302 Heading,
303 Html,
304 Img,
305 Preview,
306 Row,
307 Section,
308 Tailwind,
309 Text,
310 } from "@react-email/components"
311
312 type OrderPlacedEmailProps = {
313 order: OrderDTO & { customer: CustomerDTO }
314 storeName: string
315 }
316
317 function Template({ order, storeName }: OrderPlacedEmailProps) {
318 const getLocaleAmount = (amount: number) => {
319 const formatter = new Intl.NumberFormat([], {
320 style: "currency",
321 currencyDisplay: "narrowSymbol",
322 currency: order.currency_code,
323 })
324
325 return formatter.format(amount)
326 }
327
328 const items = order.items?.map((item) => {
329 const itemTotal = item.unit_price * item.quantity
330
331 return (
332 <Section key={item.id} className="border-b border-gray-200 py-4 px-0">
333 <Row className="px-0">
334 <Column className="w-1/6">
335 <Img
336 src={item.thumbnail ?? ""}
337 alt={""}
338 className="rounded-lg"
339 width="100%"
340 />
341 </Column>
342 <Column className="w-7/8 pl-4">
343 <Text className="text-sm text-black my-2">
344 {item.product_title}
345 </Text>
346 <Text className="text-xs text-black my-2">
347 {item.variant_title}
348 </Text>
349 <Text className="text-xs text-black my-2">
350 <span className="font-semibold">
351 {item.quantity} x {getLocaleAmount(item.unit_price)}
352 </span>
353 </Text>
354 <Text className="text-xs text-black font-bold my-2">
355 {getLocaleAmount(itemTotal)}
356 </Text>
357 </Column>
358 </Row>
359 </Section>
360 )
361 })
362
363 return (
364 <Tailwind>
365 <Html className="font-sans bg-gray-100">
366 <Head />
367 <Preview>Thank you for your order from {storeName}</Preview>
368 <Body className="bg-white my-10 mx-auto w-full max-w-2xl">
369 {/* Greeting and Order Confirmation */}
370 <Container className="p-6">
371 <Heading className="text-lg font-normal text-black mb-6">
372 Dear{" "}
373 {order.customer?.first_name || order.shipping_address?.first_name}
374 ,
375 </Heading>
376
377 <Text className="text-sm text-black leading-relaxed mb-6">
378 Thank you for your order. Below you will find the details for your
379 purchase.
380 </Text>
381
382 <div className="mb-6">
383 <Text className="text-sm text-black m-0 mb-1">
384 Order number:{" "}
385 <span className="font-semibold">{order.display_id}</span>
386 </Text>
387 <Text className="text-sm text-black m-0">
388 Order date:{" "}
389 <span className="font-semibold">
390 {new Date(order.created_at).toLocaleDateString("en-GB", {
391 weekday: "short",
392 month: "short",
393 day: "numeric",
394 year: "numeric",
395 })}
396 </span>
397 </Text>
398 </div>
399
400 <Text className="text-sm text-black leading-relaxed">
401 We're getting your order ready to be shipped. We will notify you
402 when it has been sent. If you have any questions, please don't
403 hesitate to contact us.
404 </Text>
405 </Container>
406
407 {/* Order Items */}
408 <Container className="px-6">
409 <Heading className="text-base font-semibold text-black mb-2">
410 Your Items
411 </Heading>
412
413 {items}
414
415 {/* Order Summary */}
416 <Section className="mt-8 border-t border-gray-200 pt-6">
417 <Row className="text-black">
418 <Column className="w-1/2">
419 <Text className="text-sm m-0 mb-2">Subtotal (incl. VAT)</Text>
420 </Column>
421 <Column className="w-1/2 text-right">
422 <Text className="text-sm m-0 mb-2">
423 {getLocaleAmount(order.item_total as number)}
424 </Text>
425 </Column>
426 </Row>
427 <Row className="text-black">
428 <Column className="w-1/2">
429 <Text className="text-sm m-0 mb-2">Shipping Total</Text>
430 </Column>
431 <Column className="w-1/2 text-right">
432 <Text className="text-sm m-0 mb-2">
433 {getLocaleAmount(order.shipping_total as number)}
434 </Text>
435 </Column>
436 </Row>
437 {Number(order.discount_total) > 0 ? (
438 <Row className="text-black">
439 <Column className="w-1/2">
440 <Text className="text-sm m-0 mb-2">Discount</Text>
441 </Column>
442 <Column className="w-1/2 text-right">
443 <Text className="text-sm m-0 mb-2">
444 -{getLocaleAmount(order.discount_total as number)}
445 </Text>
446 </Column>
447 </Row>
448 ) : null}
449 <Row className="text-black font-bold">
450 <Column className="w-1/2">
451 <Text className="text-sm m-0 mb-2">Total</Text>
452 </Column>
453 <Column className="w-1/2 text-right">
454 <Text className="text-sm m-0 mb-2">
455 {getLocaleAmount(order.total as number)}
456 </Text>
457 </Column>
458 </Row>
459 <Row className="text-black">
460 <Column className="w-1/2">
461 <Text className="text-sm m-0 italic">VAT Amount</Text>
462 </Column>
463 <Column className="w-1/2 text-right">
464 <Text className="text-sm m-0 italic">
465 {getLocaleAmount(order.tax_total as number)}
466 </Text>
467 </Column>
468 </Row>
469 </Section>
470
471 {/* Shipping Address */}
472 <Section className="mt-8 mb-8">
473 <Heading className="text-base font-semibold text-black mb-2">
474 Shipping Address
475 </Heading>
476 <Text className="text-sm text-black m-0 mb-1">
477 {order.shipping_address?.first_name}{" "}
478 {order.shipping_address?.last_name}
479 </Text>
480 <Text className="text-sm text-black m-0 mb-1">
481 {order.shipping_address?.address_1}
482 </Text>
483 {order.shipping_address?.address_2 && (
484 <Text className="text-sm text-black m-0 mb-1">
485 {order.shipping_address?.address_2}
486 </Text>
487 )}
488 <Text className="text-sm text-black m-0 mb-1">
489 {order.shipping_address?.postal_code}{" "}
490 {order.shipping_address?.city}
491 </Text>
492 <Text className="text-sm text-black m-0">
493 {order.shipping_address?.country_code?.toUpperCase()}
494 </Text>
495 </Section>
496 </Container>
497
498 {/* Footer */}
499 <Section className="bg-gray-50 p-6 mt-10">
500 <Text className="text-center text-black text-sm">
501 Order ID: {order.id}
502 </Text>
503 <Text className="text-center text-black text-xs mt-4">
504 © {new Date().getFullYear()} {storeName}, Inc. All rights reserved.
505 </Text>
506 </Section>
507 </Body>
508 </Html>
509 </Tailwind>
510 )
511 }
512
513 export default function getOrderPlacedTemplate(props?: OrderPlacedEmailProps) {
514 const demoData: OrderDTO & { customer: CustomerDTO } = {
515 id: "order_01J5K6M8N9P0Q1R2S3T4U5V6W7",
516 display_id: 1234,
517 created_at: new Date().toISOString(),
518 currency_code: "usd",
519 item_total: 59.99,
520 shipping_total: 5,
521 discount_total: 0,
522 tax_total: 8.4,
523 total: 64.99,
524 items: [
525 {
526 id: "item_01",
527 product_title: "Premium Wireless Headphones",
528 variant_title: "Black / Standard",
529 thumbnail: "https://images.unsplash.com/photo-1618366712010-f4ae9c647dcb",
530 unit_price: 29.99,
531 quantity: 2,
532 },
533 ],
534 customer: {
535 id: "cust_01",
536 email: "customer@example.com",
537 first_name: "John",
538 last_name: "Doe",
539 },
540 shipping_address: {
541 first_name: "John",
542 last_name: "Doe",
543 address_1: "123 Main Street",
544 address_2: "Apt 4B",
545 city: "New York",
546 postal_code: "10001",
547 country_code: "us",
548 },
549 } as OrderDTO & { customer: CustomerDTO }
550
551 return <Template order={props?.order ?? demoData} storeName={props?.storeName ?? "Demo Store"} />
552 }
553 ```
554
555 Then, to send the Order Placed email when an order is created, create a subscriber at `src/subscribers/order-created.ts` with the following content:
556
557 ```ts title="src/subscribers/order-created.ts"
558 import type {
559 SubscriberArgs,
560 SubscriberConfig,
561 } from "@medusajs/framework"
562 import { render, pretty } from "@react-email/render"
563 import getOrderPlacedTemplate from "../emails/order-placed"
564 import {
565 Modules,
566 ContainerRegistrationKeys,
567 } from "@medusajs/framework/utils"
568
569 export default async function orderPlacedHandler({
570 event: { data },
571 container,
572 }: SubscriberArgs<{ id: string }>) {
573 const query = container.resolve(
574 ContainerRegistrationKeys.QUERY
575 )
576
577 const {
578 data: [store],
579 } = await query.graph({
580 entity: "store",
581 fields: ["name"],
582 })
583
584 const {
585 data: [order],
586 } = await query.graph({
587 entity: "order",
588 fields: [
589 "id",
590 "email",
591 "display_id",
592 "created_at",
593
594 // Customer
595 "customer.first_name",
596 "customer.email",
597
598 // Items
599 "items.id",
600 "items.product_title",
601 "items.variant_title",
602 "items.quantity",
603 "items.unit_price",
604
605 // Shipping address
606 "shipping_address.first_name",
607 "shipping_address.last_name",
608 "shipping_address.address_1",
609 "shipping_address.address_2",
610 "shipping_address.city",
611 "shipping_address.postal_code",
612 "shipping_address.country_code",
613
614 // Totals
615 "item_total",
616 "shipping_total",
617 "discount_total",
618 "tax_total",
619 "total",
620 ],
621 filters: {
622 id: data.id,
623 },
624 })
625
626 if (!order.customer?.email) {
627 console.warn(`Order ${order.id} has no customer email, skipping notification`)
628 return
629 }
630
631 const notificationModule = container.resolve(
632 Modules.NOTIFICATION
633 )
634
635 const html = await pretty(
636 await render(getOrderPlacedTemplate({
637 order: order as any,
638 storeName: store.name,
639 }))
640 )
641
642 await notificationModule.createNotifications({
643 to: order.customer.email,
644 // optional: set from email
645 // from: "no-reply@yourdomain.com"
646 channel: "email",
647 content: {
648 html,
649 subject: `Order Confirmation - ${store.name}`,
650 },
651 })
652 }
653
654 export const config: SubscriberConfig = {
655 event: "order.placed",
656 }
657 ```
658
659 This subscriber listens for the `order.placed` event. When triggered, it:
660
661 1. Retrieves the store name and order details.
662 2. Renders the Order Placed email template to an HTML string using React Email's `render` function, passing the `getOrderPlacedTemplate` function with the order and store name as props.
663 3. Sends the email by creating a notification using Medusa's Notification Module.
664
665 Whenever a new order is placed, the customer will receive an Order Placed email using your React Email template.
666
667 ### Reset Password Email Template
668
669 The Reset Password email template allows customers and admin users to reset their password if they forget it. It typically includes a link to a password reset page.
670
671 You can use the following template for your Reset Password email:
672
673 ```tsx title="src/emails/reset-password.tsx"
674 import {
675 Text,
676 Container,
677 Heading,
678 Html,
679 Section,
680 Tailwind,
681 Head,
682 Preview,
683 Body,
684 Button,
685 } from "@react-email/components"
686
687 type ResetPasswordEmailProps = {
688 resetPasswordUrl: string
689 storeName: string
690 }
691
692 function Template({ resetPasswordUrl, storeName }: ResetPasswordEmailProps) {
693 return (
694 <Tailwind>
695 <Html className="font-sans bg-gray-100">
696 <Head />
697 <Preview>Reset your password</Preview>
698 <Body className="bg-white my-10 mx-auto w-full max-w-2xl">
699 {/* Main Content */}
700 <Container className="p-6 text-center">
701 <Heading className="text-lg font-semibold text-black mb-6">
702 You have submitted a password change request.
703 </Heading>
704
705 <Section className="text-center my-8">
706 <Button
707 href={resetPasswordUrl}
708 className="bg-black text-white py-3 px-8 inline-block"
709 >
710 Reset password
711 </Button>
712 </Section>
713
714 <Text className="text-sm text-black leading-relaxed mt-6">
715 If you didn't request a password reset, you can safely ignore this
716 email.
717 </Text>
718 </Container>
719
720 {/* Footer */}
721 <Section className="bg-gray-50 p-6 mt-10">
722 <Text className="text-center text-black text-xs mt-4">
723 © {new Date().getFullYear()} {storeName}, Inc. All rights reserved.
724 </Text>
725 </Section>
726 </Body>
727 </Html>
728 </Tailwind>
729 )
730 }
731
732 export default function getResetPasswordTemplate(props?: ResetPasswordEmailProps) {
733 return (
734 <Template
735 resetPasswordUrl={props?.resetPasswordUrl ?? "#"}
736 storeName={props?.storeName ?? "Demo Store"}
737 />
738 )
739 }
740 ```
741
742 Then, to send the Reset Password email when a password reset is requested, create a subscriber at `src/subscribers/reset-password.ts` with the following content:
743
744 ```ts title="src/subscribers/reset-password.ts"
745 import { SubscriberArgs } from "@medusajs/medusa"
746 import {
747 Modules,
748 ContainerRegistrationKeys,
749 } from "@medusajs/framework/utils"
750 import { render, pretty } from "@react-email/render"
751 import getResetPasswordTemplate from "../emails/reset-password"
752
753 export default async function resetPasswordTokenHandler({
754 event: { data: {
755 entity_id: email,
756 token,
757 actor_type,
758 } },
759 container,
760 }: SubscriberArgs<{ entity_id: string, token: string, actor_type: string }>) {
761 const notificationModuleService = container.resolve(
762 Modules.NOTIFICATION
763 )
764 const config = container.resolve(
765 ContainerRegistrationKeys.CONFIG_MODULE
766 )
767 const query = container.resolve(
768 ContainerRegistrationKeys.QUERY
769 )
770
771 const {
772 data: [store],
773 } = await query.graph({
774 entity: "store",
775 fields: ["name"],
776 })
777
778 let urlPrefix = ""
779
780 if (actor_type === "customer") {
781 urlPrefix = config.admin.storefrontUrl || "https://storefront.com"
782 } else {
783 const backendUrl = config.admin.backendUrl !== "/" ? config.admin.backendUrl :
784 "http://localhost:9000"
785 const adminPath = config.admin.path
786 urlPrefix = `${backendUrl}${adminPath}`
787 }
788
789 const resetPasswordUrl = `${urlPrefix}/reset-password?token=${token}&email=${email}`
790
791 const html = await pretty(
792 await render(getResetPasswordTemplate({
793 resetPasswordUrl,
794 storeName: store.name,
795 }))
796 )
797
798 await notificationModuleService.createNotifications({
799 to: email,
800 // optional: set from email
801 // from: "no-reply@yourdomain.com"
802 channel: "email",
803 content: {
804 html,
805 subject: `Reset your password - ${store.name}`,
806 },
807 })
808 }
809
810 export const config: SubscriberConfig = {
811 event: "auth.password_reset",
812 }
813 ```
814
815 This subscriber listens for the `auth.password_reset` event. When triggered, it:
816
817 1. Retrieves the store name.
818 2. Constructs the reset password URL based on whether the request is for a customer or admin user.
819 3. Renders the Reset Password email template to an HTML string using React Email's `render` function, passing the `getResetPasswordTemplate` function with the reset password URL and store name as props.
820 4. Sends the email by creating a notification using Medusa's Notification Module.
821
822 Whenever a user requests a password reset, they will receive a Reset Password email using your React Email template.