sendSlack(results.slack, results.render, notification, function (err, data) { if (err) { notification.log = err; notification.state = 'FAILED'; logger.warn('slack send error', err) } else { notification.log = data; notification.state = 'COMPLETE'; logger.info('slack send complete', data) } db.notificationDelivery.updateById(notification.id, notification, cb); });
sendVoice(results.s3, results.twilio, notification, function (err, data) { if (err) { notification.log = err; notification.state = 'FAILED'; logger.warn('voice send error', err); } else { notification.log = data; notification.state = 'COMPLETE'; logger.info('voice send complete', data); } db.notificationDelivery.updateById(notification.id, notification, cb); });