Set mail-from to environment immediately after changed,

allow user set a blank username&password pair in SMTP setting.
This commit is contained in:
lkisme 2017-03-09 23:29:48 +08:00
parent a64e9af1d3
commit 72c3651be4
2 changed files with 22 additions and 5 deletions

View file

@ -103,8 +103,8 @@ BlazeComponent.extendComponent({
try{
const host = this.checkField('#mail-server-host');
const port = this.checkField('#mail-server-port');
const username = this.checkField('#mail-server-username');
const password = this.checkField('#mail-server-password');
const username = $('#mail-server-username').val().trim();
const password = $('#mail-server-password').val().trim();
const from = this.checkField('#mail-server-from');
Settings.update(Settings.findOne()._id, {$set:{'mailServer.host':host, 'mailServer.port': port, 'mailServer.username': username,
'mailServer.password': password, 'mailServer.from': from}});