-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
78 lines (69 loc) · 2.5 KB
/
Gruntfile.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
68
69
70
71
72
73
74
75
76
77
78
/*
* grunt-postmark
* https://github.com/activecampaign/grunt-postmark.git
*/
module.exports = function (grunt) {
var secret = grunt.file.readJSON('secrets.json');
var config = grunt.file.readJSON('config.json');
grunt.initConfig({
secret: secret,
config: config,
/* Postmark
------------------------------------------------- */
postmark: {
options: {
serverToken: "<%= secret.postmark.server_token %>"
},
email: {
from: "<%= config.postmark.from %>",
to: "<%= config.postmark.to %>",
subject: "<%= config.postmark.subject %>",
src: ["test/email.html"]
},
bulk: {
from: "<%= config.postmark.from %>",
to: "<%= config.postmark.to %>",
subject: "<%= config.postmark.subject %>",
src: ["test/*.html"]
}
},
"postmark-templates-upload": {
options: {
ephemeralUploadResultsProperty: "<%= config.templates && config.templates.ephemeralUploadResultsProperty %>",
serverToken: "<%= secret.postmark.server_token %>"
},
test_email: {
name: "testing-postmark-templates-js1-" + new Date().valueOf(),
subject: "Testing grunt-postmark-templates",
htmlSrc: "test/email.html",
textSrc: "test/email.txt"
},
test_email_again: {
name: "testing-postmark-templates-js2-" + new Date().valueOf(),
subject: "Testing grunt-postmark-templates (again)",
htmlSrc: "test/email.html",
textSrc: "test/email.txt"
},
test_email_inline_body: {
name: "testing-postmark-templates-js3-" + new Date().valueOf(),
subject: "Testing grunt-postmark-templates (inline body)",
htmlBody: "<html><body><h1>Another email test</h1></body></html>",
textBody: "Hello from grunt-postmark-templates\n"
}
},
"postmark-templates-output": {
options: {
cleanOutput: "<%= config.templates && config.templates.cleanOutput %>",
outputFile: "<%= config.templates && config.templates.outputFile || config.templates && config.templates.file %>",
ephemeralUploadResultsProperty: "<%= config.templates && config.templates.ephemeralUploadResultsProperty %>"
}
},
"postmark-templates-parse": {
options: {
inputFile: "<%= config.templates && config.templates.inputFile || config.templates && config.templates.file %>"
}
}
});
grunt.loadTasks("tasks");
grunt.registerTask("default", ["postmark", "postmark-templates"]);
};