@travetto/email 5.0.12 → 5.0.14
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/LICENSE +1 -1
- package/package.json +4 -4
- package/src/util.ts +3 -2
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.14",
|
|
4
4
|
"description": "Email transmission module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"directory": "module/email"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@travetto/config": "^5.0.
|
|
27
|
-
"@travetto/di": "^5.0.
|
|
28
|
-
"@travetto/runtime": "^5.0.
|
|
26
|
+
"@travetto/config": "^5.0.14",
|
|
27
|
+
"@travetto/di": "^5.0.14",
|
|
28
|
+
"@travetto/runtime": "^5.0.14",
|
|
29
29
|
"@types/mustache": "^4.2.5",
|
|
30
30
|
"mustache": "^4.2.0"
|
|
31
31
|
},
|
package/src/util.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { EmailAttachment, EmailIdentity, EmailIdentityList, EmailOptions } from
|
|
|
8
8
|
export class MailUtil {
|
|
9
9
|
/** Remove brand from text */
|
|
10
10
|
static purgeBrand(text: string): string {
|
|
11
|
-
return text.replace(/<!-- WARNING:[^\n]
|
|
11
|
+
return text.replace(/<!-- WARNING:[^\n]{0,500}\n/m, '');
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** Add brand to text */
|
|
@@ -31,7 +31,8 @@ export class MailUtil {
|
|
|
31
31
|
const attachments: EmailAttachment[] = [];
|
|
32
32
|
const contentMap = new Map<string, string>();
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// Max of 10mb
|
|
35
|
+
html = html.replace(/data:(image\/[^;]{1,50});base64,([^"']{1,10000000})/g, (__, contentType, content) => {
|
|
35
36
|
// Ensure same data uris map to a single cid
|
|
36
37
|
if (!contentMap.has(content)) {
|
|
37
38
|
const cid = `image-${idx += 1}`;
|