summaryrefslogtreecommitdiffstats
path: root/server/notifications
diff options
context:
space:
mode:
authorJulen Landa Alustiza <julen@zokormazo.info>2017-04-01 21:46:09 +0200
committerJulen Landa Alustiza <julen@zokormazo.info>2017-04-01 21:46:09 +0200
commitdfeeec308ac2c683cd3fc3f43f65efe71072af54 (patch)
tree291b5c1b39a3551f0a1fce67b90b58752d77852f /server/notifications
parent823aea497b45652e1c57916a10094cb5b0fc3ef9 (diff)
downloadwekan-dfeeec308ac2c683cd3fc3f43f65efe71072af54.tar.gz
wekan-dfeeec308ac2c683cd3fc3f43f65efe71072af54.tar.bz2
wekan-dfeeec308ac2c683cd3fc3f43f65efe71072af54.zip
Fix email settings loading:
MAIL_URL was overriden with database info all the time. Now if MAIL_URL exists is not overwritten and if neither MAIL_URL nor exists valid admin panel data MAIL_URL is not set. MAIL_FROM was ignored. Same behaviour, env variable has bigger priority than database configuration. On both cases, althrought environment variable is set, updating admin-panel mail settings will load new info and ignore the environment variable. Remove some code that is not needed anymore
Diffstat (limited to 'server/notifications')
-rw-r--r--server/notifications/email.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/server/notifications/email.js b/server/notifications/email.js
index cee874d9..2af6381e 100644
--- a/server/notifications/email.js
+++ b/server/notifications/email.js
@@ -26,17 +26,15 @@ Meteor.startup(() => {
const text = texts.join('\n\n');
user.clearEmailBuffer();
- if (Settings.findOne().mailUrl()) {
- try {
- Email.send({
- to: user.emails[0].address.toLowerCase(),
- from: Accounts.emailTemplates.from,
- subject: TAPi18n.__('act-activity-notify', {}, user.getLanguage()),
- text,
- });
- } catch (e) {
- return;
- }
+ try {
+ Email.send({
+ to: user.emails[0].address.toLowerCase(),
+ from: Accounts.emailTemplates.from,
+ subject: TAPi18n.__('act-activity-notify', {}, user.getLanguage()),
+ text,
+ });
+ } catch (e) {
+ return;
}
}, 30000);
});