-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathemail.js
67 lines (64 loc) · 1.69 KB
/
email.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import React from 'react';
import { readFileSync } from 'fs';
import {
Mjml,
MjmlHead,
MjmlTitle,
MjmlPreview,
MjmlBody,
MjmlSection,
MjmlColumn,
MjmlButton,
MjmlImage,
MjmlStyle,
MjmlText
} from 'mjml-react';
const css = readFileSync('./assets/styles.css').toString();
export const generate = () => {
return (
<Mjml>
<MjmlHead>
<MjmlTitle>Last Minute Offer</MjmlTitle>
<MjmlPreview>Last Minute Offer...</MjmlPreview>
<MjmlStyle>{css}</MjmlStyle>
<MjmlStyle>{`
.blue-column {
background-color: blue;
}
`}</MjmlStyle>
<MjmlStyle inline>{`
.red-column {
background-color: red;
}
`}</MjmlStyle>
</MjmlHead>
<MjmlBody width={500}>
<MjmlSection fullWidth backgroundColor="#efefef">
<MjmlColumn>
<MjmlImage src="https://static.wixstatic.com/media/5cb24728abef45dabebe7edc1d97ddd2.jpg" />
</MjmlColumn>
</MjmlSection>
<MjmlSection>
<MjmlColumn>
<MjmlButton padding="20px" backgroundColor="#346DB7" href="https://www.wix.com/">
I like it!
</MjmlButton>
</MjmlColumn>
</MjmlSection>
<MjmlSection>
<MjmlColumn cssClass="blue-column">
<MjmlText>I am blue</MjmlText>
</MjmlColumn>
<MjmlColumn cssClass="red-column">
<MjmlText>I am red</MjmlText>
</MjmlColumn>
</MjmlSection>
<MjmlSection>
<MjmlColumn>
<MjmlText><a href="/2">Open Second Template</a></MjmlText>
</MjmlColumn>
</MjmlSection>
</MjmlBody>
</Mjml>
);
};