Skip to content

Commit 4b63106

Browse files
feat(tasks): add mailgun and amazons3 tasks and packages
1 parent 7f11da5 commit 4b63106

File tree

4 files changed

+816
-294
lines changed

4 files changed

+816
-294
lines changed

README.md

+38-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ based on [github.com/leemunroe](https://github.com/leemunroe/grunt-email-workflo
33

44
## Changelog
55

6-
### v0.2.0 - 09/01/2024
6+
### v0.2.0 - 24/01/2024
77

88
* update packages and dependencies for current node versions: nvm not needed
9-
* disable third-party connections (see [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation))
9+
* remove obsolete tasks and packages
1010

1111
## Purpose
1212

@@ -24,7 +24,6 @@ You may already have these installed on your system. If not, you'll have to inst
2424

2525
* Node.js - [Install Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
2626
* Grunt-cli and Grunt (`npm install grunt-cli -g`)
27-
* (optional) [Litmus](https://litmus.com) - Tests the email across all clients/browsers/devices
2827

2928
## Getting started
3029

@@ -39,12 +38,46 @@ cd grunt-email-workflow
3938
npm install
4039
```
4140

42-
#### 2. Run Grunt
41+
#### 2. Create secrets.json
42+
43+
Create a `secrets.json` file in your project root as **outlined below under "[Sensitive Information](#sensitive-information)"**.
44+
45+
#### 3. Run Grunt
4346

4447
Run `grunt build` and check out your `/dist` folder to see your compiled and inlined email templates.
4548

4649
Run `grunt serve`, a new live-reload browser tab will open. Happy coding :)
4750

51+
### Sensitive information
52+
53+
We encourage you __not__ to store sensitive data in your git repository. If you must, please look into [git-encrypt](https://github.com/shadowhand/git-encrypt) or some other method of encrypting your configuration secrets.
54+
55+
1. Create a file `secrets.json` in your project root.
56+
2. Paste the following sample code in `secrets.json` and enter the appropriate credentials for the services you want to connect with.
57+
58+
If you don't use or need these services **it's ok to skip this step**.
59+
60+
```json
61+
{
62+
"mailgun": {
63+
"api_key": "YOUR MG PRIVATE API KEY",
64+
"domain": "YOURDOMAIN.COM",
65+
"sender": "E.G. POSTMASTER@YOURDOMAIN.COM",
66+
"recipient": "WHO YOU WANT TO SEND THE EMAIL TO"
67+
},
68+
"s3": {
69+
"key": "AMAZON S3 KEY",
70+
"secret": "AMAZON S3 SECRET",
71+
"region": "AMAZON S3 REGION",
72+
"bucketname": "AMAZON S3 BUCKET NAME",
73+
"bucketdir": "AMAZON S3 BUCKET SUBDIRECTORY (optional)",
74+
"bucketuri": "AMAZON S3 PATH (ex: https://s3.amazonaws.com/)"
75+
}
76+
}
77+
```
78+
79+
After this you should be good to go. Run `grunt build` and your email templates should appear automagically in a `/dist` folder.
80+
4881
## How it works
4982

5083
### CSS
@@ -87,7 +120,7 @@ In terminal, run `grunt build`. This will:
87120

88121
See the output HTML in the `dist` folder. Open them and preview it the browser.
89122

90-
Alternatively run `grunt serve`. This will check for any changes you make to your .scss and .hbs templates, automatically run the tasks, and serve you a preview in the browser on http://localhost:4000. Saves you having to run grunt every time you make a change.
123+
Alternatively run `grunt serve`. This will check for any changes you make to your .scss and .hbs templates, automatically run the tasks, and serve you a preview in the browser on [http://localhost:4000](http://localhost:4000). Saves you having to run grunt every time you make a change.
91124

92125
### Browser-based previews
93126

grunt/aliases.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1+
# Where we tell Grunt what to do when we type "grunt" into the terminal
2+
# $ grunt
13
default:
24
- serve
35

6+
# Use grunt send if you want to actually send the email to your inbox
7+
# $ grunt send --template=transaction.html
8+
send:
9+
- mailgun
10+
11+
# Upload image files to Amazon S3
12+
# $ grunt s3upload
13+
s3upload:
14+
- build
15+
- aws_s3:prod
16+
- cdn:aws_s3
17+
18+
# Compile all templates once and exit the process
19+
# $ grunt build
420
build:
521
- clean
622
- sass:dist
723
- assemble
824
- juice
925

26+
# Launch the express server and start watching
27+
# $ grunt serve
1028
serve:
1129
- build
1230
- sass:preview

0 commit comments

Comments
 (0)