mjmlhelper 2.2.6 → 2.2.8
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.md +21 -0
- package/README.md +129 -122
- package/package.json +17 -11
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) David Vielhuber
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,122 +1,129 @@
|
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
1
|
+
[](https://github.com/vielhuber/mjmlhelper/tags)
|
|
2
|
+
[](https://www.php-fig.org/psr/psr-12/)
|
|
3
|
+
[](https://github.com/vielhuber/mjmlhelper/blob/main/LICENSE.md)
|
|
4
|
+
[](https://github.com/vielhuber/mjmlhelper/commits)
|
|
5
|
+
[](https://www.npmjs.com/package/mjmlhelper)
|
|
6
|
+
[](https://www.npmjs.com/package/mjmlhelper)
|
|
7
|
+
|
|
8
|
+
# 🌈 mjmlhelper 🌈
|
|
9
|
+
|
|
10
|
+
mjmlhelper is a little toolbox for [mjml](https://mjml.io/) (v4.X) that...
|
|
11
|
+
|
|
12
|
+
- sends mails from the command line for testing and production,
|
|
13
|
+
- automatically inlines or uploads images for testing purposes,
|
|
14
|
+
- converts your template to the drag&drop editors of [CleverReach](https://www.cleverreach.com) and [Mailchimp](https://mailchimp.com).
|
|
15
|
+
|
|
16
|
+
it also includes a small boilerplate and some nifty updates for mjml.
|
|
17
|
+
|
|
18
|
+
## installation
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npm init -y
|
|
22
|
+
npm install mjmlhelper
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## setup
|
|
26
|
+
|
|
27
|
+
copy out all boilerplate files:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
cp -r ./node_modules/mjmlhelper/boilerplate/. .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
run the initial setup:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
npm run setup
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
then edit your smtp credentials in `mjmlhelper.json` for sending out emails:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"from": "from@tld.com",
|
|
44
|
+
"name": "Testmailer",
|
|
45
|
+
"smtp": "your.hostname.com",
|
|
46
|
+
"username": "your-username",
|
|
47
|
+
"password": "your-password",
|
|
48
|
+
"port": 465,
|
|
49
|
+
"ssl": "tls",
|
|
50
|
+
|
|
51
|
+
"to": "to@tld.com",
|
|
52
|
+
"to": ["to@tld.com", "to2@tld.com"],
|
|
53
|
+
"to": "list.txt",
|
|
54
|
+
|
|
55
|
+
"images": false,
|
|
56
|
+
"images": "inline",
|
|
57
|
+
"images": "upload",
|
|
58
|
+
|
|
59
|
+
"log": "log.txt",
|
|
60
|
+
"ftp": {
|
|
61
|
+
"host": "localhost",
|
|
62
|
+
"port": 21,
|
|
63
|
+
"username": "foo",
|
|
64
|
+
"password": "bar",
|
|
65
|
+
"path": "/path/to/folder/",
|
|
66
|
+
"url": "https://tld.com/path/to/folder"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## usage
|
|
72
|
+
|
|
73
|
+
build mjml (and watch)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
npm run watch
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
build mjml
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
npm run build
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
send out mail
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
npm run mail
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
create a ready-to-import zip file for CleverReach
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
npm run cleverreach
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
create a ready-to-import zip file for Mailchimp
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
npm run mailchimp
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## placeholders
|
|
104
|
+
|
|
105
|
+
### auto
|
|
106
|
+
|
|
107
|
+
- `%UNSUBSCRIBE%`
|
|
108
|
+
- `%WEBVERSION%`
|
|
109
|
+
- `%PREVIEWTEXT%`
|
|
110
|
+
|
|
111
|
+
### cleverreach
|
|
112
|
+
|
|
113
|
+
- `{UNSUBSCRIBE}`
|
|
114
|
+
- `{ONLINE_VERSION}`
|
|
115
|
+
- `{CAMPAIGN}`
|
|
116
|
+
|
|
117
|
+
### mailchimp
|
|
118
|
+
|
|
119
|
+
- `*|UNSUB|*`
|
|
120
|
+
- `*|ARCHIVE|*`
|
|
121
|
+
- `*|MC_PREVIEW_TEXT|*`
|
|
122
|
+
|
|
123
|
+
## notes
|
|
124
|
+
|
|
125
|
+
### mailchimp
|
|
126
|
+
|
|
127
|
+
creating mailchimp emails in their classic editor can be a bit tedious. a first block is created by default and you can only create more blocks by duplicating the first one and choosing any other variant. if there is only one block left, it cannot be deleted.
|
|
128
|
+
|
|
129
|
+
images must be sized (width is crucial) exactly as mentionned in the image edit mask (Content Studio).
|
package/package.json
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mjmlhelper",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "mjmlhelper.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@prettier/plugin-php": "^0.
|
|
8
|
-
"archiver": "^
|
|
7
|
+
"@prettier/plugin-php": "^0.25.0",
|
|
8
|
+
"archiver": "^8.0.0",
|
|
9
9
|
"cli-error-notifier": "^3.0.2",
|
|
10
|
-
"fs-extra": "^11.3.
|
|
10
|
+
"fs-extra": "^11.3.5",
|
|
11
11
|
"ftp": "^0.3.10",
|
|
12
|
-
"jsdom": "^
|
|
13
|
-
"mjml": "^
|
|
14
|
-
"nodemailer": "^8.0.
|
|
15
|
-
"npm": "^11.
|
|
12
|
+
"jsdom": "^29.1.1",
|
|
13
|
+
"mjml": "^5.2.2",
|
|
14
|
+
"nodemailer": "^8.0.7",
|
|
15
|
+
"npm": "^11.15.0",
|
|
16
16
|
"onchange": "^7.1.0",
|
|
17
|
-
"prettier": "^3.8.
|
|
17
|
+
"prettier": "^3.8.3"
|
|
18
18
|
},
|
|
19
|
-
"devDependencies": {},
|
|
20
19
|
"scripts": {
|
|
21
20
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
21
|
},
|
|
23
22
|
"keywords": [],
|
|
24
23
|
"author": "David Vielhuber <david@vielhuber.de>",
|
|
25
|
-
"license": "
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+ssh://git@github.com/vielhuber/mjmlhelper.git"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
}
|
|
26
32
|
}
|