-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (44 loc) · 1.41 KB
/
index.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
function mandEmail(){
var mandrill = require
('node-mandrill')
('1IAxU49l9P6IffQbvCOwqw');
var subscription = [
]
mandrill('/messages/send-template', {
template_name: "welcome-email",
template_content: [],
message: {
to: [{email: '@gmail.com', name:'Akash'}],
from_email: '[email protected]',
subject: "Thanks For Subscribing!",
text: "Thanks for subscribing to Swarajya Magazine",
merge: true,
merge_language: "handlebars",
global_merge_vars:
[ {
name:"subscription",
content:
{
"subscribed-till":"12-08-2023"
}
}]
}
}, function(error, response)
{
// there was an error
if (error) console.log( JSON.stringify(error) );
//everything's good, lets see what mandrill said
else console.log(response);
});
}
mandEmail();
// const mailchimpClient = require("mailchimp_transactional")("YOUR_API_KEY");
// const run = async () => {
// const response = await mailchimpClient.messages.sendTemplate({
// template_name: "template_name",
// template_content: [{}],
// message: {},
// });
// console.log(response);
// };
// run();