Skip to content

Commit 9a5fd78

Browse files
committedAug 22, 2024
fix(react-email): Email template preview failing with emails having spaces (#1591)
1 parent e98dc77 commit 9a5fd78

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
 

‎.changeset/nasty-carrots-burn.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-email": patch
3+
---
4+
5+
fix email template preview failing with emails having spaces

‎apps/web/src/app/examples/page.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ const items = [
102102
path: "magic-links/jobaccepted-magic-link",
103103
name: "Job Accepted / Magic Link with code",
104104
author: "vonsa",
105-
}
106-
]
105+
},
106+
];
107107

108108
const title = "Examples — React Email";
109109
const description = "Open source templates built with React Email";

‎packages/react-email/src/app/preview/[...slug]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface PreviewParams {
1717
const Page = async ({ params }: { params: PreviewParams }) => {
1818
// will come in here as segments of a relative path to the email
1919
// ex: ['authentication', 'verify-password.tsx']
20-
const slug = params.slug.join('/');
20+
const slug = decodeURIComponent(params.slug.join('/'));
2121
const emailsDirMetadata = await getEmailsDirectoryMetadata(
2222
emailsDirectoryAbsolutePath,
2323
);

0 commit comments

Comments
 (0)
Please sign in to comment.