-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
40 lines (32 loc) · 1.02 KB
/
test.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
const Emaily = require('./index.js');
(async function () {
const emaily = new Emaily({
profile: 'arc',
});
const { text, html, csv } = await emaily.template({
firstName: 'joe',
lastName: 'shmoe',
$name: 'Foo Bar', // required
$byName: 'Arc IO', // required
$domain: 'https://foobar.com/', // required
$byDomain: 'https://arcdev.io/', // required
});
// const text = 'Hello World Text';
// const html = '<html><head></head><body><h1>Hello World HTML</h1></body></html>';
const result = await emaily.send({
text,
html,
subject: 'Test Subject',
// cc: [
// '[email protected]',
// ],
to: [
// '[email protected]',
// '[email protected]',
],
from: '"No Reply" <[email protected]>',
attachments: [ { name: 'customer.csv', data: csv } ]
});
console.log(result);
}()).catch(console.error);