forked from Squatconf/Website
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
804 B
JavaScript
28 lines
804 B
JavaScript
var fs = require('fs')
|
|
, path = require('path')
|
|
, config = require('../../config')
|
|
, api_key = config.mailjetKey
|
|
, domain = 'squatconf.eu'
|
|
, mailgun = require('mailgun-js')({apiKey: api_key, domain: domain})
|
|
, allMail = fs.readFileSync('./mails.txt','utf8').split('\n')
|
|
, filename = 'sq03.txt'
|
|
, filepath = path.join(__dirname, filename)
|
|
, file = fs.readFileSync(filepath)
|
|
, text = fs.readFileSync('./sq03.txt', 'utf8')
|
|
, attch = new mailgun.Attachment({data: file, filename: filename})
|
|
;
|
|
var data = {
|
|
from: 'no-reply@squatconf.eu',
|
|
to: 'no-reply@squatconf.eu',
|
|
bcc: allMail,
|
|
subject: 'squatConf - venue infos',
|
|
text: text,
|
|
//html: text,
|
|
attachment: attch
|
|
};
|
|
|
|
mailgun.messages().send(data, function (error, body) {
|
|
console.log(body);
|
|
});
|
|
|