File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -10,26 +10,43 @@ import {
10
10
Image ,
11
11
InText ,
12
12
Mjml ,
13
+ Preview ,
13
14
Raw ,
14
15
Section ,
15
16
Style ,
16
17
Text ,
17
18
Title ,
18
19
Wrapper ,
19
20
} from '@seedcompany/nestjs-email/templates' ;
20
- import type { ComponentProps , ReactElement , ReactNode } from 'react' ;
21
+ import {
22
+ type ComponentProps ,
23
+ Fragment ,
24
+ type ReactElement ,
25
+ type ReactNode ,
26
+ } from 'react' ;
21
27
import { useFrontendUrl } from './frontend-url' ;
22
28
23
29
export const EmailTemplate = ( {
24
30
title,
31
+ preview,
25
32
children,
26
33
} : {
27
34
title : string ;
35
+ preview ?: ReactNode ;
28
36
children : ReactNode ;
29
37
} ) => (
30
38
< Mjml lang = "en" >
31
39
< Head >
32
40
< Title > { `${ title } - CORD Field` } </ Title >
41
+ { preview != null && (
42
+ < Preview >
43
+ { preview }
44
+ { /* Fill the remaining space with nothing-ness so the email context is avoided */ }
45
+ { [ ...Array ( 140 ) . keys ( ) ] . map ( ( i ) => (
46
+ < Fragment key = { i } > ͏‌ </ Fragment >
47
+ ) ) }
48
+ </ Preview >
49
+ ) }
33
50
< Theme />
34
51
< Style
35
52
inline
You can’t perform that action at this time.
0 commit comments