Files
old-web/app/services/notificationService.js
2019-06-27 17:29:57 +02:00

23 lines
637 B
JavaScript

const Promise = require("bluebird");
const db = require("../models/index");
const { allMarketAlerts } = require('../helpers/db/dbHelper');
const { createMarketAlertEmailTemplate, sendBulkEmail } = require('../helpers/awsEmail');
async function processNotifications() {
try {
const marketAlerts = await allMarketAlerts(false);
// await createMarketAlertEmailTemplate();
await sendBulkEmail(marketAlerts);
// console.log(marketAlerts);
process.exit();
} catch (e) {
console.log("NOTIFICATION SERVICE: could not send notifications reason: ", e);
}
}
processNotifications();