Reload mailer config once admin updates Mailtrain settings

This commit is contained in:
Andris Reinman 2016-12-25 17:59:50 +02:00
parent 9946f70992
commit 50f6c8d101
6 changed files with 27 additions and 11 deletions

View file

@ -87,6 +87,11 @@ router.post('/update', passport.parseForm, passport.csrfProtection, (req, res) =
let storeSettings = () => {
if (i >= keys.length) {
mailer.update();
tools.workers.forEach(worker => {
worker.send({
reload: true
});
});
req.flash('success', 'Settings updated');
return res.redirect('/settings');
}