@@ -7,37 +7,63 @@ import {
7
7
Divider ,
8
8
Font ,
9
9
Head ,
10
+ HideInText ,
10
11
Image ,
11
12
InText ,
12
13
Mjml ,
14
+ Preview ,
13
15
Raw ,
14
16
Section ,
15
17
Style ,
16
18
Text ,
17
19
Title ,
18
20
Wrapper ,
19
21
} from '@seedcompany/nestjs-email/templates' ;
20
- import type { ComponentProps , ReactElement , ReactNode } from 'react' ;
22
+ import {
23
+ type ComponentProps ,
24
+ Fragment ,
25
+ type ReactElement ,
26
+ type ReactNode ,
27
+ } from 'react' ;
21
28
import { useFrontendUrl } from './frontend-url' ;
22
29
23
30
export const EmailTemplate = ( {
24
31
title,
32
+ preview,
25
33
children,
26
34
} : {
27
35
title : string ;
36
+ preview ?: ReactNode ;
28
37
children : ReactNode ;
29
38
} ) => (
30
39
< Mjml lang = "en" >
31
40
< Head >
32
- < Title > { `${ title } - CORD Field` } </ Title >
41
+ < Title > { title } </ Title >
42
+ { preview != null && (
43
+ < HideInText >
44
+ < Preview >
45
+ { preview }
46
+ { /* Fill the remaining space with nothing-ness so the email context is avoided */ }
47
+ { [ ...Array ( 140 ) . keys ( ) ] . map ( ( i ) => (
48
+ < Fragment key = { i } > ͏‌ </ Fragment >
49
+ ) ) }
50
+ </ Preview >
51
+ </ HideInText >
52
+ ) }
33
53
< Theme />
34
54
< Style
35
55
inline
36
56
children = { `
57
+ .body {
58
+ /* prevents card shadow being cut off */
59
+ padding: 8px;
60
+ /* add more just to look more symmetrical with branding header */
61
+ padding-bottom: 48px;
62
+ }
37
63
.card-shadow {
38
- -webkit-box-shadow: 0px 5px 5px -3px rgba(0,0,0, 0.2), 0px 8px 10px 1px rgba(0,0,0, 0.14), 0px 3px 14px 2px rgba(0,0,0, 0.12);
39
- -moz-box-shadow: 0px 5px 5px -3px rgba(0,0,0, 0.2), 0px 8px 10px 1px rgba(0,0,0, 0.14), 0px 3px 14px 2px rgba(0,0,0, 0.12);
40
- box-shadow: 0px 5px 5px -3px rgba(0,0,0, 0.2), 0px 8px 10px 1px rgba(0,0,0, 0.14), 0px 3px 14px 2px rgba(0,0,0, 0.12);
64
+ -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px ;
65
+ -moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px ;
66
+ box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px ;
41
67
}
42
68
.button-shadow td {
43
69
-webkit-box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
@@ -48,7 +74,9 @@ export const EmailTemplate = ({
48
74
/>
49
75
</ Head >
50
76
< Body >
51
- < Branding />
77
+ < HideInText >
78
+ < Branding />
79
+ </ HideInText >
52
80
53
81
< Wrapper
54
82
cssClass = "card-shadow"
@@ -65,15 +93,15 @@ export const Theme = () => (
65
93
< >
66
94
< Font name = "sofia-pro" href = "https://use.typekit.net/qrd6jxb.css" />
67
95
< Attributes >
68
- < All fontFamily = "sofia-pro" fontSize = "16px" />
69
- < Body width = { 600 } backgroundColor = "#fafafa" >
96
+ < All fontFamily = "sofia-pro, sans-serif " fontSize = "16px" />
97
+ < Body width = { 600 } backgroundColor = "#fafafa" cssClass = "body" >
70
98
{ [ ] }
71
99
</ Body >
72
100
< Section backgroundColor = "#ffffff" > { } </ Section >
73
101
< Text lineHeight = "1.5" > { } </ Text >
74
102
< Button
75
103
color = "#ffffff"
76
- backgroundColor = "#64b145 "
104
+ backgroundColor = "#1ea973 "
77
105
padding = "8px 22px"
78
106
cssClass = "button-shadow"
79
107
>
@@ -90,7 +118,7 @@ export const Theme = () => (
90
118
) ;
91
119
92
120
export const Branding = ( ) : ReactElement => {
93
- const iconUrl = useFrontendUrl ( '/images/web-app-manifest-192x192 .png' ) ;
121
+ const iconUrl = useFrontendUrl ( '/images/cord-icon .png' ) ;
94
122
return (
95
123
< Section backgroundColor = "#fafafa" >
96
124
< Column verticalAlign = "middle" width = "80px" >
@@ -104,7 +132,7 @@ export const Branding = (): ReactElement => {
104
132
</ Column >
105
133
< Column verticalAlign = "middle" width = "220px" >
106
134
< Text fontSize = { 32 } align = "center" >
107
- CORD Field
135
+ < span style = { { whiteSpace : 'nowrap !important' } } > CORD Field</ span >
108
136
</ Text >
109
137
</ Column >
110
138
< TextBreak />
0 commit comments