2016-05-21 17:06:24 +02:00
|
|
|
'use strict';
|
|
|
|
|
2016-05-24 16:40:57 +02:00
|
|
|
angular.module('ffffng').factory('MailQueueJob', function (MailService, Logger) {
|
2016-05-21 17:06:24 +02:00
|
|
|
return {
|
2016-06-03 23:42:17 +02:00
|
|
|
run: function (callback) {
|
2016-05-21 17:06:24 +02:00
|
|
|
MailService.sendPendingMails(function (err) {
|
|
|
|
if (err) {
|
2016-05-24 16:40:57 +02:00
|
|
|
Logger.tag('mail', 'queue').error('Error sending pending mails:', err);
|
2016-05-21 17:06:24 +02:00
|
|
|
}
|
2016-06-03 23:42:17 +02:00
|
|
|
|
|
|
|
callback();
|
2016-05-21 17:06:24 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|