@capillarytech/creatives-library 7.12.90 → 7.12.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/cdnTransformation.js +7 -8
- package/utils/tests/__snapshots__/cdnTransformation.test.js.snap +298 -0
- package/utils/tests/cdnTransformation.mockdata.js +301 -0
- package/utils/tests/cdnTransformation.test.js +76 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +9 -9
- package/v2Containers/MobilePush/Create/index.js +1 -4
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +2 -2
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import cloneDeep from "lodash/cloneDeep";
|
|
2
2
|
import isEmpty from "lodash/isEmpty";
|
|
3
|
+
import forOwn from "lodash/forOwn";
|
|
3
4
|
import isNumber from "lodash/isNumber";
|
|
4
5
|
/* eslint-disable no-unused-expressions */
|
|
5
6
|
import { parse } from "node-html-parser";
|
|
@@ -124,10 +125,8 @@ export const getCdnUrl = ({
|
|
|
124
125
|
|
|
125
126
|
newUrl += CDN_TRANSFORMATION_URL_SUFFIX;
|
|
126
127
|
|
|
127
|
-
Object.keys(applicableTransformations)?.forEach((transformationParam) => {
|
|
128
|
-
|
|
129
|
-
applicableTransformations?.[transformationParam];
|
|
130
|
-
|
|
128
|
+
// Object.keys(applicableTransformations)?.forEach((transformationParam) => {
|
|
129
|
+
forOwn(applicableTransformations, (transformationParamVal, transformationParam)=>{
|
|
131
130
|
try {
|
|
132
131
|
switch (transformationParam) {
|
|
133
132
|
case "height":
|
|
@@ -160,10 +159,10 @@ export const getCdnUrl = ({
|
|
|
160
159
|
} catch (e) {
|
|
161
160
|
console.log("some error occured while applying transformation",e);
|
|
162
161
|
}
|
|
163
|
-
})
|
|
162
|
+
})
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
newUrl +=
|
|
165
|
+
newUrl += `/${INTOUCH_CREATIVE_ASSETS}${assetKey}`;
|
|
167
166
|
return newUrl;
|
|
168
167
|
};
|
|
169
168
|
|
|
@@ -180,8 +179,8 @@ export const updateImagesInHtml = (htmlContents) => {
|
|
|
180
179
|
const imageSrc = element.getAttribute("src");
|
|
181
180
|
const isAsset = regex.test(imageSrc);
|
|
182
181
|
if (isAsset) {
|
|
183
|
-
const height = element.getAttribute("height");
|
|
184
|
-
const width = element.getAttribute("width");
|
|
182
|
+
const height = Number(element.getAttribute("height"));
|
|
183
|
+
const width = Number(element.getAttribute("width"));
|
|
185
184
|
const newUrl = getCdnUrl({
|
|
186
185
|
url: imageSrc,
|
|
187
186
|
height,
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`transformEmailTemplate() should transform email template 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"name": "test template1",
|
|
6
|
+
"type": "EMAIL",
|
|
7
|
+
"versions": Object {
|
|
8
|
+
"base": Object {
|
|
9
|
+
"activeTab": "en",
|
|
10
|
+
"base": true,
|
|
11
|
+
"en": Object {
|
|
12
|
+
"drag_drop_id": "",
|
|
13
|
+
"id": "5f7b61605f09ebe595ff404e",
|
|
14
|
+
"is_drag_drop": false,
|
|
15
|
+
"iso_code": "en",
|
|
16
|
+
"lang_id": 69,
|
|
17
|
+
"language": "English",
|
|
18
|
+
"tabKey": "6",
|
|
19
|
+
"template-content": "<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional //EN\\" \\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\">
|
|
20
|
+
<html xmlns=\\"http://www.w3.org/1999/xhtml\\" xmlns:o=\\"urn:schemas-microsoft-com:office:office\\" xmlns:v=\\"urn:schemas-microsoft-com:vml\\">
|
|
21
|
+
<head><meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=utf-8\\"><meta name=\\"viewport\\" content=\\"width=device-width\\">
|
|
22
|
+
<title></title>
|
|
23
|
+
|
|
24
|
+
<style type=\\"text/css\\">body {
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0; }
|
|
27
|
+
|
|
28
|
+
table,
|
|
29
|
+
td,
|
|
30
|
+
tr {
|
|
31
|
+
vertical-align: top;
|
|
32
|
+
border-collapse: collapse; }
|
|
33
|
+
|
|
34
|
+
* {
|
|
35
|
+
line-height: inherit; }
|
|
36
|
+
|
|
37
|
+
a[x-apple-data-detectors=true] {
|
|
38
|
+
color: inherit !important;
|
|
39
|
+
text-decoration: none !important; }
|
|
40
|
+
</style>
|
|
41
|
+
<style id=\\"media-query\\" type=\\"text/css\\">@media (max-width: 520px) {
|
|
42
|
+
.block-grid,
|
|
43
|
+
.col {
|
|
44
|
+
min-width: 320px !important;
|
|
45
|
+
max-width: 100% !important;
|
|
46
|
+
display: block !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.block-grid {
|
|
50
|
+
width: 100% !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.col {
|
|
54
|
+
width: 100% !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.col > div {
|
|
58
|
+
margin: 0 auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
img.fullwidth,
|
|
62
|
+
img.fullwidthOnMobile {
|
|
63
|
+
max-width: 100% !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.no-stack .col {
|
|
67
|
+
min-width: 0 !important;
|
|
68
|
+
display: table-cell !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.no-stack.two-up .col {
|
|
72
|
+
width: 50% !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.no-stack .col.num4 {
|
|
76
|
+
width: 33% !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.no-stack .col.num8 {
|
|
80
|
+
width: 66% !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.no-stack .col.num4 {
|
|
84
|
+
width: 33% !important;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.no-stack .col.num3 {
|
|
88
|
+
width: 25% !important;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.no-stack .col.num6 {
|
|
92
|
+
width: 50% !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.no-stack .col.num9 {
|
|
96
|
+
width: 75% !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.video-block {
|
|
100
|
+
max-width: none !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.mobile_hide {
|
|
104
|
+
min-height: 0px;
|
|
105
|
+
max-height: 0px;
|
|
106
|
+
max-width: 0px;
|
|
107
|
+
display: none;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
font-size: 0px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.desktop_hide {
|
|
113
|
+
display: block !important;
|
|
114
|
+
max-height: none !important;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
118
|
+
</head>
|
|
119
|
+
<body class=\\"clean-body\\" style=\\"margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;\\">
|
|
120
|
+
<p>hello world</p>
|
|
121
|
+
|
|
122
|
+
<p><img alt=\\"Capillary Image\\" height=\\"171\\" src=\\"https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=257,height=171,format=auto,quality=75,/intouch_creative_assets/b4b63b22-8a81-41ee-a8df-6db967fc.jpg\\" width=\\"257\\"></p>
|
|
123
|
+
|
|
124
|
+
<table bgcolor=\\"#FFFFFF\\" cellpadding=\\"0\\" cellspacing=\\"0\\" class=\\"nl-container\\" role=\\"presentation\\" style=\\"background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%\\" valign=\\"top\\">
|
|
125
|
+
<tbody>
|
|
126
|
+
<tr style=\\"vertical-align:top\\" valign=\\"top\\">
|
|
127
|
+
<td style=\\"vertical-align:top; word-break:break-word\\">
|
|
128
|
+
<div style=\\"background-color:transparent\\">
|
|
129
|
+
<div class=\\"block-grid\\" style=\\"background-color:transparent; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:0; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word\\">
|
|
130
|
+
<div style=\\"background-color:transparent; border-collapse:collapse; display:table; width:100%\\">
|
|
131
|
+
<div class=\\"col num12\\" style=\\"display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px\\">
|
|
132
|
+
<div style=\\"width:100% !important\\"></div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</td>
|
|
138
|
+
</tr>
|
|
139
|
+
</tbody>
|
|
140
|
+
</table>
|
|
141
|
+
</body>
|
|
142
|
+
</html>
|
|
143
|
+
",
|
|
144
|
+
},
|
|
145
|
+
"selectedLanguages": Array [
|
|
146
|
+
"en",
|
|
147
|
+
],
|
|
148
|
+
"subject": "hello subject",
|
|
149
|
+
"tabKey": "6",
|
|
150
|
+
},
|
|
151
|
+
"history": Array [
|
|
152
|
+
Object {
|
|
153
|
+
"activeTab": "en",
|
|
154
|
+
"base": true,
|
|
155
|
+
"en": Object {
|
|
156
|
+
"drag_drop_id": "",
|
|
157
|
+
"id": "5f7b61605f09ebe595ff404e",
|
|
158
|
+
"is_drag_drop": false,
|
|
159
|
+
"iso_code": "en",
|
|
160
|
+
"lang_id": 69,
|
|
161
|
+
"language": "English",
|
|
162
|
+
"tabKey": "6",
|
|
163
|
+
"template-content": "<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional //EN\\" \\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\">
|
|
164
|
+
<html xmlns=\\"http://www.w3.org/1999/xhtml\\" xmlns:o=\\"urn:schemas-microsoft-com:office:office\\" xmlns:v=\\"urn:schemas-microsoft-com:vml\\">
|
|
165
|
+
<head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=utf-8\\"><meta name=\\"viewport\\" content=\\"width=device-width\\"><!--[if !mso]><meta http-equiv=\\"X-UA-Compatible\\" content=\\"IE=edge\\"><!--<![endif]-->
|
|
166
|
+
<title></title>
|
|
167
|
+
<!--[if !mso]><!--<![endif]-->
|
|
168
|
+
<style type=\\"text/css\\">body {
|
|
169
|
+
margin: 0;
|
|
170
|
+
padding: 0; }
|
|
171
|
+
|
|
172
|
+
table,
|
|
173
|
+
td,
|
|
174
|
+
tr {
|
|
175
|
+
vertical-align: top;
|
|
176
|
+
border-collapse: collapse; }
|
|
177
|
+
|
|
178
|
+
* {
|
|
179
|
+
line-height: inherit; }
|
|
180
|
+
|
|
181
|
+
a[x-apple-data-detectors=true] {
|
|
182
|
+
color: inherit !important;
|
|
183
|
+
text-decoration: none !important; }
|
|
184
|
+
</style>
|
|
185
|
+
<style id=\\"media-query\\" type=\\"text/css\\">@media (max-width: 520px) {
|
|
186
|
+
.block-grid,
|
|
187
|
+
.col {
|
|
188
|
+
min-width: 320px !important;
|
|
189
|
+
max-width: 100% !important;
|
|
190
|
+
display: block !important;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.block-grid {
|
|
194
|
+
width: 100% !important;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.col {
|
|
198
|
+
width: 100% !important;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.col > div {
|
|
202
|
+
margin: 0 auto;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
img.fullwidth,
|
|
206
|
+
img.fullwidthOnMobile {
|
|
207
|
+
max-width: 100% !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.no-stack .col {
|
|
211
|
+
min-width: 0 !important;
|
|
212
|
+
display: table-cell !important;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.no-stack.two-up .col {
|
|
216
|
+
width: 50% !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.no-stack .col.num4 {
|
|
220
|
+
width: 33% !important;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.no-stack .col.num8 {
|
|
224
|
+
width: 66% !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.no-stack .col.num4 {
|
|
228
|
+
width: 33% !important;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.no-stack .col.num3 {
|
|
232
|
+
width: 25% !important;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.no-stack .col.num6 {
|
|
236
|
+
width: 50% !important;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.no-stack .col.num9 {
|
|
240
|
+
width: 75% !important;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.video-block {
|
|
244
|
+
max-width: none !important;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.mobile_hide {
|
|
248
|
+
min-height: 0px;
|
|
249
|
+
max-height: 0px;
|
|
250
|
+
max-width: 0px;
|
|
251
|
+
display: none;
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
font-size: 0px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.desktop_hide {
|
|
257
|
+
display: block !important;
|
|
258
|
+
max-height: none !important;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
</style>
|
|
262
|
+
</head>
|
|
263
|
+
<body class=\\"clean-body\\" style=\\"margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;\\">
|
|
264
|
+
<p><!--[if IE]><div class=\\"ie-browser\\"><![endif]-->hello world</p>
|
|
265
|
+
|
|
266
|
+
<p><img alt=\\"Capillary Image\\" height=\\"171\\" src=\\"https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/b4b63b22-8a81-41ee-a8df-6db967fc.jpg\\" width=\\"257\\" /></p>
|
|
267
|
+
|
|
268
|
+
<table bgcolor=\\"#FFFFFF\\" cellpadding=\\"0\\" cellspacing=\\"0\\" class=\\"nl-container\\" role=\\"presentation\\" style=\\"background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%\\" valign=\\"top\\">
|
|
269
|
+
<tbody>
|
|
270
|
+
<tr style=\\"vertical-align:top\\" valign=\\"top\\">
|
|
271
|
+
<td style=\\"vertical-align:top; word-break:break-word\\"><!--[if (mso)|(IE)]><table width=\\"100%\\" cellpadding=\\"0\\" cellspacing=\\"0\\" border=\\"0\\"><tr><td align=\\"center\\" style=\\"background-color:#FFFFFF\\"><![endif]-->
|
|
272
|
+
<div style=\\"background-color:transparent\\">
|
|
273
|
+
<div class=\\"block-grid\\" style=\\"background-color:transparent; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:0; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word\\">
|
|
274
|
+
<div style=\\"background-color:transparent; border-collapse:collapse; display:table; width:100%\\"><!--[if (mso)|(IE)]><table width=\\"100%\\" cellpadding=\\"0\\" cellspacing=\\"0\\" border=\\"0\\" style=\\"background-color:transparent;\\"><tr><td align=\\"center\\"><table cellpadding=\\"0\\" cellspacing=\\"0\\" border=\\"0\\" style=\\"width:500px\\"><tr class=\\"layout-full-width\\" style=\\"background-color:transparent\\"><![endif]--><!--[if (mso)|(IE)]><td align=\\"center\\" width=\\"500\\" style=\\"background-color:transparent;width:500px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\\" valign=\\"top\\"><table width=\\"100%\\" cellpadding=\\"0\\" cellspacing=\\"0\\" border=\\"0\\"><tr><td style=\\"padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px;\\"><![endif]-->
|
|
275
|
+
<div class=\\"col num12\\" style=\\"display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px\\">
|
|
276
|
+
<div style=\\"width:100% !important\\"><!--[if (!mso)&(!IE)]><div style=\\"border-top:0px solid transparent; border-left:0px solid transparent; border-bottom:0px solid transparent; border-right:0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;\\"><!--<![endif]--><!--[if (!mso)&(!IE)]></div><!--<![endif]--></div>
|
|
277
|
+
</div>
|
|
278
|
+
<!--[if (mso)|(IE)]></td></tr></table><![endif]--><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
<!--[if (mso)|(IE)]></td></tr></table><![endif]--></td>
|
|
282
|
+
</tr>
|
|
283
|
+
</tbody>
|
|
284
|
+
</table>
|
|
285
|
+
<!--[if (IE)]></div><![endif]--></body>
|
|
286
|
+
</html>
|
|
287
|
+
",
|
|
288
|
+
},
|
|
289
|
+
"selectedLanguages": Array [
|
|
290
|
+
"en",
|
|
291
|
+
],
|
|
292
|
+
"subject": "hello subject",
|
|
293
|
+
"tabKey": "6",
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
}
|
|
298
|
+
`;
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
export const emailRawInput = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
|
|
3
|
+
<head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width"><!--[if !mso]><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
|
|
4
|
+
<title></title>
|
|
5
|
+
<!--[if !mso]><!--<![endif]-->
|
|
6
|
+
<style type="text/css">body {
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0; }
|
|
9
|
+
|
|
10
|
+
table,
|
|
11
|
+
td,
|
|
12
|
+
tr {
|
|
13
|
+
vertical-align: top;
|
|
14
|
+
border-collapse: collapse; }
|
|
15
|
+
|
|
16
|
+
* {
|
|
17
|
+
line-height: inherit; }
|
|
18
|
+
|
|
19
|
+
a[x-apple-data-detectors=true] {
|
|
20
|
+
color: inherit !important;
|
|
21
|
+
text-decoration: none !important; }
|
|
22
|
+
</style>
|
|
23
|
+
<style id="media-query" type="text/css">@media (max-width: 520px) {
|
|
24
|
+
.block-grid,
|
|
25
|
+
.col {
|
|
26
|
+
min-width: 320px !important;
|
|
27
|
+
max-width: 100% !important;
|
|
28
|
+
display: block !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.block-grid {
|
|
32
|
+
width: 100% !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.col {
|
|
36
|
+
width: 100% !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.col > div {
|
|
40
|
+
margin: 0 auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
img.fullwidth,
|
|
44
|
+
img.fullwidthOnMobile {
|
|
45
|
+
max-width: 100% !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.no-stack .col {
|
|
49
|
+
min-width: 0 !important;
|
|
50
|
+
display: table-cell !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.no-stack.two-up .col {
|
|
54
|
+
width: 50% !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.no-stack .col.num4 {
|
|
58
|
+
width: 33% !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.no-stack .col.num8 {
|
|
62
|
+
width: 66% !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.no-stack .col.num4 {
|
|
66
|
+
width: 33% !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.no-stack .col.num3 {
|
|
70
|
+
width: 25% !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.no-stack .col.num6 {
|
|
74
|
+
width: 50% !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.no-stack .col.num9 {
|
|
78
|
+
width: 75% !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.video-block {
|
|
82
|
+
max-width: none !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.mobile_hide {
|
|
86
|
+
min-height: 0px;
|
|
87
|
+
max-height: 0px;
|
|
88
|
+
max-width: 0px;
|
|
89
|
+
display: none;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
font-size: 0px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.desktop_hide {
|
|
95
|
+
display: block !important;
|
|
96
|
+
max-height: none !important;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
100
|
+
</head>
|
|
101
|
+
<body class="clean-body" style="margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;">
|
|
102
|
+
<p><img alt="Capillary Image" height="184" src="https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/d5679e9b-1ff4-4e7c-8f77-30160048.png" width="328" /></p>
|
|
103
|
+
<!--[if IE]><div class="ie-browser"><![endif]-->
|
|
104
|
+
|
|
105
|
+
<p>Hello world</p>
|
|
106
|
+
|
|
107
|
+
<table bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" class="nl-container" role="presentation" style="background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%" valign="top">
|
|
108
|
+
<tbody>
|
|
109
|
+
<tr style="vertical-align:top" valign="top">
|
|
110
|
+
<td style="vertical-align:top; word-break:break-word"><!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color:#FFFFFF"><![endif]-->
|
|
111
|
+
<div style="background-color:transparent">
|
|
112
|
+
<div class="block-grid" style="background-color:transparent; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:0; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word">
|
|
113
|
+
<div style="background-color:transparent; border-collapse:collapse; display:table; width:100%"><!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:transparent;"><tr><td align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px"><tr class="layout-full-width" style="background-color:transparent"><![endif]--><!--[if (mso)|(IE)]><td align="center" width="500" style="background-color:transparent;width:500px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px;"><![endif]-->
|
|
114
|
+
<div class="col num12" style="display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px">
|
|
115
|
+
<div style="width:100% !important"><!--[if (!mso)&(!IE)]><div style="border-top:0px solid transparent; border-left:0px solid transparent; border-bottom:0px solid transparent; border-right:0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;"><!--<![endif]--><!--[if (!mso)&(!IE)]></div><!--<![endif]--></div>
|
|
116
|
+
</div>
|
|
117
|
+
<!--[if (mso)|(IE)]></td></tr></table><![endif]--><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<!--[if (mso)|(IE)]></td></tr></table><![endif]--></td>
|
|
121
|
+
</tr>
|
|
122
|
+
</tbody>
|
|
123
|
+
</table>
|
|
124
|
+
<!--[if (IE)]></div><![endif]--></body>
|
|
125
|
+
</html>
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
export const emailRawTransformed = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
129
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
|
|
130
|
+
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width">
|
|
131
|
+
<title></title>
|
|
132
|
+
|
|
133
|
+
<style type="text/css">body {
|
|
134
|
+
margin: 0;
|
|
135
|
+
padding: 0; }
|
|
136
|
+
|
|
137
|
+
table,
|
|
138
|
+
td,
|
|
139
|
+
tr {
|
|
140
|
+
vertical-align: top;
|
|
141
|
+
border-collapse: collapse; }
|
|
142
|
+
|
|
143
|
+
* {
|
|
144
|
+
line-height: inherit; }
|
|
145
|
+
|
|
146
|
+
a[x-apple-data-detectors=true] {
|
|
147
|
+
color: inherit !important;
|
|
148
|
+
text-decoration: none !important; }
|
|
149
|
+
</style>
|
|
150
|
+
<style id="media-query" type="text/css">@media (max-width: 520px) {
|
|
151
|
+
.block-grid,
|
|
152
|
+
.col {
|
|
153
|
+
min-width: 320px !important;
|
|
154
|
+
max-width: 100% !important;
|
|
155
|
+
display: block !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.block-grid {
|
|
159
|
+
width: 100% !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.col {
|
|
163
|
+
width: 100% !important;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.col > div {
|
|
167
|
+
margin: 0 auto;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
img.fullwidth,
|
|
171
|
+
img.fullwidthOnMobile {
|
|
172
|
+
max-width: 100% !important;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.no-stack .col {
|
|
176
|
+
min-width: 0 !important;
|
|
177
|
+
display: table-cell !important;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.no-stack.two-up .col {
|
|
181
|
+
width: 50% !important;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.no-stack .col.num4 {
|
|
185
|
+
width: 33% !important;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.no-stack .col.num8 {
|
|
189
|
+
width: 66% !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.no-stack .col.num4 {
|
|
193
|
+
width: 33% !important;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.no-stack .col.num3 {
|
|
197
|
+
width: 25% !important;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.no-stack .col.num6 {
|
|
201
|
+
width: 50% !important;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.no-stack .col.num9 {
|
|
205
|
+
width: 75% !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.video-block {
|
|
209
|
+
max-width: none !important;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.mobile_hide {
|
|
213
|
+
min-height: 0px;
|
|
214
|
+
max-height: 0px;
|
|
215
|
+
max-width: 0px;
|
|
216
|
+
display: none;
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
font-size: 0px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.desktop_hide {
|
|
222
|
+
display: block !important;
|
|
223
|
+
max-height: none !important;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
</style>
|
|
227
|
+
</head>
|
|
228
|
+
<body class="clean-body" style="margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;">
|
|
229
|
+
<p><img alt="Capillary Image" height="184" src="https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=328,height=184,format=auto,quality=75,/intouch_creative_assets/d5679e9b-1ff4-4e7c-8f77-30160048.png" width="328"></p>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<p>Hello world</p>
|
|
233
|
+
|
|
234
|
+
<table bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" class="nl-container" role="presentation" style="background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%" valign="top">
|
|
235
|
+
<tbody>
|
|
236
|
+
<tr style="vertical-align:top" valign="top">
|
|
237
|
+
<td style="vertical-align:top; word-break:break-word">
|
|
238
|
+
<div style="background-color:transparent">
|
|
239
|
+
<div class="block-grid" style="background-color:transparent; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:0; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word">
|
|
240
|
+
<div style="background-color:transparent; border-collapse:collapse; display:table; width:100%">
|
|
241
|
+
<div class="col num12" style="display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px">
|
|
242
|
+
<div style="width:100% !important"></div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
</td>
|
|
248
|
+
</tr>
|
|
249
|
+
</tbody>
|
|
250
|
+
</table>
|
|
251
|
+
</body>
|
|
252
|
+
</html>
|
|
253
|
+
`;
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
export const emailTemplateRaw = {
|
|
257
|
+
"versions": {
|
|
258
|
+
"base": {
|
|
259
|
+
"activeTab": "en",
|
|
260
|
+
"en": {
|
|
261
|
+
"is_drag_drop": false,
|
|
262
|
+
"lang_id": 69,
|
|
263
|
+
"iso_code": "en",
|
|
264
|
+
"language": "English",
|
|
265
|
+
"template-content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n<head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta name=\"viewport\" content=\"width=device-width\"><!--[if !mso]><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]-->\n\t<title></title>\n\t<!--[if !mso]><!--<![endif]-->\n\t<style type=\"text/css\">body {\n margin: 0;\n padding: 0; }\n\ntable,\ntd,\ntr {\n vertical-align: top;\n border-collapse: collapse; }\n\n* {\n line-height: inherit; }\n\na[x-apple-data-detectors=true] {\n color: inherit !important;\n text-decoration: none !important; }\n\t</style>\n\t<style id=\"media-query\" type=\"text/css\">@media (max-width: 520px) {\n .block-grid,\n.col {\n min-width: 320px !important;\n max-width: 100% !important;\n display: block !important;\n }\n\n .block-grid {\n width: 100% !important;\n }\n\n .col {\n width: 100% !important;\n }\n\n .col > div {\n margin: 0 auto;\n }\n\n img.fullwidth,\nimg.fullwidthOnMobile {\n max-width: 100% !important;\n }\n\n .no-stack .col {\n min-width: 0 !important;\n display: table-cell !important;\n }\n\n .no-stack.two-up .col {\n width: 50% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num8 {\n width: 66% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num3 {\n width: 25% !important;\n }\n\n .no-stack .col.num6 {\n width: 50% !important;\n }\n\n .no-stack .col.num9 {\n width: 75% !important;\n }\n\n .video-block {\n max-width: none !important;\n }\n\n .mobile_hide {\n min-height: 0px;\n max-height: 0px;\n max-width: 0px;\n display: none;\n overflow: hidden;\n font-size: 0px;\n }\n\n .desktop_hide {\n display: block !important;\n max-height: none !important;\n }\n}\n\t</style>\n</head>\n<body class=\"clean-body\" style=\"margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;\">\n<p><!--[if IE]><div class=\"ie-browser\"><![endif]-->hello world</p>\n\n<p><img alt=\"Capillary Image\" height=\"171\" src=\"https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/b4b63b22-8a81-41ee-a8df-6db967fc.jpg\" width=\"257\" /></p>\n\n<table bgcolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" class=\"nl-container\" role=\"presentation\" style=\"background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%\" valign=\"top\">\n\t<tbody>\n\t\t<tr style=\"vertical-align:top\" valign=\"top\">\n\t\t\t<td style=\"vertical-align:top; word-break:break-word\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"center\" style=\"background-color:#FFFFFF\"><![endif]-->\n\t\t\t<div style=\"background-color:transparent\">\n\t\t\t<div class=\"block-grid\" style=\"background-color:transparent; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:0; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word\">\n\t\t\t<div style=\"background-color:transparent; border-collapse:collapse; display:table; width:100%\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:transparent;\"><tr><td align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px\"><tr class=\"layout-full-width\" style=\"background-color:transparent\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"background-color:transparent;width:500px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px;\"><![endif]-->\n\t\t\t<div class=\"col num12\" style=\"display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px\">\n\t\t\t<div style=\"width:100% !important\"><!--[if (!mso)&(!IE)]><div style=\"border-top:0px solid transparent; border-left:0px solid transparent; border-bottom:0px solid transparent; border-right:0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]--><!--[if (!mso)&(!IE)]></div><!--<![endif]--></div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--></td>\n\t\t</tr>\n\t</tbody>\n</table>\n<!--[if (IE)]></div><![endif]--></body>\n</html>\n",
|
|
266
|
+
"drag_drop_id": "",
|
|
267
|
+
"tabKey": "6",
|
|
268
|
+
"id": "5f7b61605f09ebe595ff404e"
|
|
269
|
+
},
|
|
270
|
+
"selectedLanguages": [
|
|
271
|
+
"en"
|
|
272
|
+
],
|
|
273
|
+
"base": true,
|
|
274
|
+
"tabKey": "6",
|
|
275
|
+
"subject": "hello subject"
|
|
276
|
+
},
|
|
277
|
+
"history": [
|
|
278
|
+
{
|
|
279
|
+
"activeTab": "en",
|
|
280
|
+
"en": {
|
|
281
|
+
"is_drag_drop": false,
|
|
282
|
+
"lang_id": 69,
|
|
283
|
+
"iso_code": "en",
|
|
284
|
+
"language": "English",
|
|
285
|
+
"template-content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n<head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta name=\"viewport\" content=\"width=device-width\"><!--[if !mso]><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]-->\n\t<title></title>\n\t<!--[if !mso]><!--<![endif]-->\n\t<style type=\"text/css\">body {\n margin: 0;\n padding: 0; }\n\ntable,\ntd,\ntr {\n vertical-align: top;\n border-collapse: collapse; }\n\n* {\n line-height: inherit; }\n\na[x-apple-data-detectors=true] {\n color: inherit !important;\n text-decoration: none !important; }\n\t</style>\n\t<style id=\"media-query\" type=\"text/css\">@media (max-width: 520px) {\n .block-grid,\n.col {\n min-width: 320px !important;\n max-width: 100% !important;\n display: block !important;\n }\n\n .block-grid {\n width: 100% !important;\n }\n\n .col {\n width: 100% !important;\n }\n\n .col > div {\n margin: 0 auto;\n }\n\n img.fullwidth,\nimg.fullwidthOnMobile {\n max-width: 100% !important;\n }\n\n .no-stack .col {\n min-width: 0 !important;\n display: table-cell !important;\n }\n\n .no-stack.two-up .col {\n width: 50% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num8 {\n width: 66% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num3 {\n width: 25% !important;\n }\n\n .no-stack .col.num6 {\n width: 50% !important;\n }\n\n .no-stack .col.num9 {\n width: 75% !important;\n }\n\n .video-block {\n max-width: none !important;\n }\n\n .mobile_hide {\n min-height: 0px;\n max-height: 0px;\n max-width: 0px;\n display: none;\n overflow: hidden;\n font-size: 0px;\n }\n\n .desktop_hide {\n display: block !important;\n max-height: none !important;\n }\n}\n\t</style>\n</head>\n<body class=\"clean-body\" style=\"margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;\">\n<p><!--[if IE]><div class=\"ie-browser\"><![endif]-->hello world</p>\n\n<p><img alt=\"Capillary Image\" height=\"171\" src=\"https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/b4b63b22-8a81-41ee-a8df-6db967fc.jpg\" width=\"257\" /></p>\n\n<table bgcolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" class=\"nl-container\" role=\"presentation\" style=\"background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%\" valign=\"top\">\n\t<tbody>\n\t\t<tr style=\"vertical-align:top\" valign=\"top\">\n\t\t\t<td style=\"vertical-align:top; word-break:break-word\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"center\" style=\"background-color:#FFFFFF\"><![endif]-->\n\t\t\t<div style=\"background-color:transparent\">\n\t\t\t<div class=\"block-grid\" style=\"background-color:transparent; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:0; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word\">\n\t\t\t<div style=\"background-color:transparent; border-collapse:collapse; display:table; width:100%\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:transparent;\"><tr><td align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px\"><tr class=\"layout-full-width\" style=\"background-color:transparent\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"background-color:transparent;width:500px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px;\"><![endif]-->\n\t\t\t<div class=\"col num12\" style=\"display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px\">\n\t\t\t<div style=\"width:100% !important\"><!--[if (!mso)&(!IE)]><div style=\"border-top:0px solid transparent; border-left:0px solid transparent; border-bottom:0px solid transparent; border-right:0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]--><!--[if (!mso)&(!IE)]></div><!--<![endif]--></div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--></td>\n\t\t</tr>\n\t</tbody>\n</table>\n<!--[if (IE)]></div><![endif]--></body>\n</html>\n",
|
|
286
|
+
"drag_drop_id": "",
|
|
287
|
+
"tabKey": "6",
|
|
288
|
+
"id": "5f7b61605f09ebe595ff404e"
|
|
289
|
+
},
|
|
290
|
+
"selectedLanguages": [
|
|
291
|
+
"en"
|
|
292
|
+
],
|
|
293
|
+
"base": true,
|
|
294
|
+
"tabKey": "6",
|
|
295
|
+
"subject": "hello subject"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
"type": "EMAIL",
|
|
300
|
+
"name": "test template1"
|
|
301
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as cdnUtils from '../cdnTransformation';
|
|
2
|
+
import * as mockdata from './cdnTransformation.mockdata';
|
|
3
|
+
|
|
4
|
+
describe('getCdnUrl()',()=>{
|
|
5
|
+
it('should return s3 url if bucket subfolder doesn\'t contain intouch_creative_assets',()=>{
|
|
6
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/test/2c9233ed-0959-4aff-b749-9171b5c8.jpg`;
|
|
7
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'EMAIL'});
|
|
8
|
+
expect(GENERATED_CDN_URL).toEqual(TEST_S3_URL);
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('should return s3 if channelName is not defined',()=>{
|
|
12
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`;
|
|
13
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL});
|
|
14
|
+
expect(GENERATED_CDN_URL).toEqual(TEST_S3_URL);
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('should return s3 if specified channelSubType doesn\'t exist',()=>{
|
|
18
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`;
|
|
19
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'LINE', channelSubType: 'ABC'});
|
|
20
|
+
expect(GENERATED_CDN_URL).toEqual(TEST_S3_URL);
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('Should replace s3 url with cdn url for email when h/w are not provided',()=>{
|
|
24
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`;
|
|
25
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'EMAIL'})
|
|
26
|
+
const EXPECTED_CDN_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/format=auto,quality=75,/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`
|
|
27
|
+
expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('Should replace s3 url with cdn url for email when h/w are provided',()=>{
|
|
31
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`;
|
|
32
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'EMAIL', height: 100, width: 200})
|
|
33
|
+
const EXPECTED_CDN_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=200,height=100,format=auto,quality=75,/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`
|
|
34
|
+
expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('should replace cdn url with new cdn url for email incase h/w etc changed', ()=>{
|
|
38
|
+
const TEST_S3_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=200,height=100,format=auto,quality=75,/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`
|
|
39
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'EMAIL', height: 400, width: 500})
|
|
40
|
+
const EXPECTED_CDN_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=500,height=400,format=auto,quality=75,/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`
|
|
41
|
+
expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('should replace cdn url with new cdn url incase channelName is LINE and channelSubType is RICH_MESSAGE ',()=>{
|
|
45
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8`;
|
|
46
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'LINE', channelSubType: 'RICH_MESSAGE'})
|
|
47
|
+
const EXPECTED_CDN_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1040,quality=75,/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8`
|
|
48
|
+
expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('should replace cdn url with new cdn url for channels which has predefined h/w for channel', ()=>{
|
|
52
|
+
const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`;
|
|
53
|
+
const GENERATED_CDN_URL = cdnUtils.getCdnUrl({url: TEST_S3_URL, channelName: 'RCS'})
|
|
54
|
+
const EXPECTED_CDN_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1440,height=720,quality=75,/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.jpg`
|
|
55
|
+
expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
describe('updateImagesInHtml()',()=>{
|
|
61
|
+
it('should update images in html',()=>{
|
|
62
|
+
const htmlContentsInput = mockdata.emailRawInput;
|
|
63
|
+
const htmlContentsOutput = cdnUtils.updateImagesInHtml(htmlContentsInput);
|
|
64
|
+
const expected = mockdata.emailRawTransformed;
|
|
65
|
+
expect(htmlContentsOutput).toEqual(expected);
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
describe('transformEmailTemplate()',()=>{
|
|
71
|
+
it('should transform email template',()=>{
|
|
72
|
+
const emailTemplateInput = mockdata.emailTemplateRaw;
|
|
73
|
+
const emailTemplateOutput = cdnUtils.transformEmailTemplates(emailTemplateInput);
|
|
74
|
+
expect(emailTemplateOutput).toMatchSnapshot();
|
|
75
|
+
})
|
|
76
|
+
})
|
|
@@ -4643,7 +4643,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
4643
4643
|
"actionLabel": "Click",
|
|
4644
4644
|
"activeIndex": 0,
|
|
4645
4645
|
"aspectRatio": "1:1",
|
|
4646
|
-
"originalContentUrl": "https://crm
|
|
4646
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
4647
4647
|
"selectedActionType": "text",
|
|
4648
4648
|
"type": "carousel",
|
|
4649
4649
|
}
|
|
@@ -6081,7 +6081,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
6081
6081
|
"actionLabel": "Click",
|
|
6082
6082
|
"activeIndex": 0,
|
|
6083
6083
|
"aspectRatio": "1:1",
|
|
6084
|
-
"originalContentUrl": "https://crm
|
|
6084
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
6085
6085
|
"selectedActionType": "text",
|
|
6086
6086
|
"type": "carousel",
|
|
6087
6087
|
}
|
|
@@ -7375,7 +7375,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
7375
7375
|
"actionLabel": "Click",
|
|
7376
7376
|
"activeIndex": 0,
|
|
7377
7377
|
"aspectRatio": "1:1",
|
|
7378
|
-
"originalContentUrl": "https://crm
|
|
7378
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
7379
7379
|
"selectedActionType": "text",
|
|
7380
7380
|
"type": "carousel",
|
|
7381
7381
|
}
|
|
@@ -8680,7 +8680,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
8680
8680
|
"actionLabel": "Click",
|
|
8681
8681
|
"activeIndex": 0,
|
|
8682
8682
|
"aspectRatio": "1:1",
|
|
8683
|
-
"originalContentUrl": "https://crm
|
|
8683
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
8684
8684
|
"selectedActionType": "text",
|
|
8685
8685
|
"type": "carousel",
|
|
8686
8686
|
}
|
|
@@ -12747,7 +12747,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
12747
12747
|
"actionLabel": "Click",
|
|
12748
12748
|
"activeIndex": 0,
|
|
12749
12749
|
"aspectRatio": "1:1",
|
|
12750
|
-
"originalContentUrl": "https://crm
|
|
12750
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
12751
12751
|
"selectedActionType": "text",
|
|
12752
12752
|
"type": "carousel",
|
|
12753
12753
|
}
|
|
@@ -14157,7 +14157,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
14157
14157
|
"actionLabel": "Click",
|
|
14158
14158
|
"activeIndex": 0,
|
|
14159
14159
|
"aspectRatio": "1:1",
|
|
14160
|
-
"originalContentUrl": "https://crm
|
|
14160
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
14161
14161
|
"selectedActionType": "text",
|
|
14162
14162
|
"type": "carousel",
|
|
14163
14163
|
}
|
|
@@ -15498,7 +15498,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
15498
15498
|
"actionLabel": "Click",
|
|
15499
15499
|
"activeIndex": 0,
|
|
15500
15500
|
"aspectRatio": "1:1",
|
|
15501
|
-
"originalContentUrl": "https://crm
|
|
15501
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
15502
15502
|
"selectedActionType": "text",
|
|
15503
15503
|
"type": "carousel",
|
|
15504
15504
|
}
|
|
@@ -16752,7 +16752,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
16752
16752
|
"actionLabel": "Click",
|
|
16753
16753
|
"activeIndex": 0,
|
|
16754
16754
|
"aspectRatio": "1:1",
|
|
16755
|
-
"originalContentUrl": "https://crm
|
|
16755
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
16756
16756
|
"selectedActionType": "text",
|
|
16757
16757
|
"type": "carousel",
|
|
16758
16758
|
}
|
|
@@ -17753,7 +17753,7 @@ exports[`line wrapper test/> should render line component new 1`] = `
|
|
|
17753
17753
|
"actionLabel": "Click",
|
|
17754
17754
|
"activeIndex": 0,
|
|
17755
17755
|
"aspectRatio": "1:1",
|
|
17756
|
-
"originalContentUrl": "https://crm
|
|
17756
|
+
"originalContentUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1024,height=1024,quality=75,/intouch_creative_assets/b9f2aa7a-3f1a-4a20-a737-8d50841.jpeg",
|
|
17757
17757
|
"selectedActionType": "text",
|
|
17758
17758
|
"type": "carousel",
|
|
17759
17759
|
}
|
|
@@ -1321,10 +1321,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1321
1321
|
duration: 2,
|
|
1322
1322
|
});
|
|
1323
1323
|
} else {
|
|
1324
|
-
|
|
1325
|
-
const blob = data.file.slice(0, -1, 'image');
|
|
1326
|
-
const newFile = new File([blob], `${name[0]}${Date.now()}.${name[1]}`, {type: 'image'});
|
|
1327
|
-
this.props.actions.uploadAsset(newFile, data.type, data.fileParams);
|
|
1324
|
+
this.props.actions.uploadAsset(data.file, data.type, data.fileParams);
|
|
1328
1325
|
}
|
|
1329
1326
|
};
|
|
1330
1327
|
selectCtaIos = (selectedConfig) => {
|
|
@@ -57166,7 +57166,7 @@ exports[`Creatives rcs test/> rcs edit with dlt fallback and save 2`] = `
|
|
|
57166
57166
|
"description": "Rcs desc",
|
|
57167
57167
|
"media": Object {
|
|
57168
57168
|
"height": "MEDIUM",
|
|
57169
|
-
"mediaUrl": "https://
|
|
57169
|
+
"mediaUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1440,height=720,quality=75,/intouch_creative_assets/8fcb2fdce8f92e4a48d4.png",
|
|
57170
57170
|
},
|
|
57171
57171
|
"mediaType": "IMAGE",
|
|
57172
57172
|
"suggestions": Array [
|
|
@@ -84708,7 +84708,7 @@ exports[`Creatives rcs test/> rcs edit with dlt fallback and save in library mod
|
|
|
84708
84708
|
"description": "Rcs desc",
|
|
84709
84709
|
"media": Object {
|
|
84710
84710
|
"height": "MEDIUM",
|
|
84711
|
-
"mediaUrl": "https://
|
|
84711
|
+
"mediaUrl": "https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=1440,height=720,quality=75,/intouch_creative_assets/8fcb2fdce8f92e4a48d4.png",
|
|
84712
84712
|
},
|
|
84713
84713
|
"mediaType": "IMAGE",
|
|
84714
84714
|
"suggestions": Array [
|