arturo-server
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _fs = require('fs'); | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _path = require('path'); | ||
@@ -66,7 +70,2 @@ | ||
this.debug(job.id + ' ' + watchers.map(function (watcher) { | ||
return watcher.email; | ||
})); | ||
return; | ||
var title = job.route.replace(/\/(.)/g, function (m, c) { | ||
@@ -78,12 +77,24 @@ return ' ' + c.toUpperCase(); | ||
from: 'automation@exceleratedigital.com', | ||
subject: title + ' ' + job.status, | ||
subject: 'JOBQUEUE: ' + title + ' ' + job.status, | ||
bcc: watchers.map(function (watcher) { | ||
return watcher.email; | ||
}), | ||
html: _nunjucks2.default.render('single.html', job) | ||
html: _nunjucks2.default.render('single/template.html', job) | ||
}; | ||
console.log(config); | ||
var images = _path2.default.join(templates, 'single/images'); | ||
var attachments = _fs2.default.readdirSync(images).map(function (filename) { | ||
return { | ||
filename: filename, | ||
path: _path2.default.join(images, filename), | ||
cid: filename | ||
}; | ||
}); | ||
if (attachments && attachments.length) { | ||
config.attachments = attachments; | ||
} | ||
if (!this.transport) return; | ||
this.debug('sending mail to ' + watchers.length + ' watchers...'); | ||
@@ -90,0 +101,0 @@ return new Promise(function (resolve, reject) { |
@@ -45,3 +45,7 @@ 'use strict'; | ||
_this.sequelize = sequelize; | ||
_this.email = new _email2.default(); | ||
_this.email = new _email2.default({ | ||
sendmail: true, | ||
newline: 'unix', | ||
path: '/usr/sbin/sendmail' | ||
}); | ||
// Shutdown.addHandler((code, sig) => new Promise(resolve => { | ||
@@ -48,0 +52,0 @@ // this.once('finish', () => { |
{ | ||
"name": "arturo-server", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A database agnostic distributed job queue (server, client, and worker).", | ||
@@ -5,0 +5,0 @@ "main": "lib/server/index.js", |
@@ -0,1 +1,2 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
@@ -32,5 +33,2 @@ import Debug from 'debug' | ||
this.debug(`${job.id} ${watchers.map(watcher => watcher.email)}`) | ||
return | ||
const title = job.route | ||
@@ -42,10 +40,20 @@ .replace(/\/(.)/g, (m, c) => ' ' + c.toUpperCase()) | ||
from: 'automation@exceleratedigital.com', | ||
subject: `${title} ${job.status}`, | ||
subject: `JOBQUEUE: ${title} ${job.status}`, | ||
bcc: watchers.map(watcher => watcher.email), | ||
html: nunjucks.render('single.html', job) | ||
html: nunjucks.render('single/template.html', job), | ||
} | ||
console.log(config) | ||
const images = path.join(templates, 'single/images') | ||
const attachments = fs.readdirSync(images).map(filename => ({ | ||
filename, | ||
path: path.join(images, filename), | ||
cid: filename | ||
})) | ||
if (attachments && attachments.length) { | ||
config.attachments = attachments | ||
} | ||
if (!this.transport) return | ||
this.debug(`sending mail to ${watchers.length} watchers...`) | ||
@@ -52,0 +60,0 @@ return new Promise((resolve, reject) => { |
@@ -12,3 +12,7 @@ import Debug from 'debug' | ||
this.sequelize = sequelize | ||
this.email = new Email() | ||
this.email = new Email({ | ||
sendmail: true, | ||
newline: 'unix', | ||
path: '/usr/sbin/sendmail' | ||
}) | ||
// Shutdown.addHandler((code, sig) => new Promise(resolve => { | ||
@@ -15,0 +19,0 @@ // this.once('finish', () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80
329989
3592
9