summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-11-28 08:49:44 +0200
committerLauri Ojansivu <x@xet7.org>2017-11-28 08:49:44 +0200
commitc048ce89f1c9e26c6973f7f18a4dd6871e57928e (patch)
tree91bebe05094003913c178f36cfb237566f3b8576 /client
parent162b15c0cdba99c406f41a80a431f2b99f4ff027 (diff)
parent44559b52a6d45df57f1ca8eeaae25d55eb7e8148 (diff)
downloadwekan-c048ce89f1c9e26c6973f7f18a4dd6871e57928e.tar.gz
wekan-c048ce89f1c9e26c6973f7f18a4dd6871e57928e.tar.bz2
wekan-c048ce89f1c9e26c6973f7f18a4dd6871e57928e.zip
Merge branch 'improve-smtp-testing' of https://github.com/nztqa/wekan into nztqa-improve-smtp-testing
Diffstat (limited to 'client')
-rw-r--r--client/components/settings/settingBody.jade3
-rw-r--r--client/components/settings/settingBody.js16
2 files changed, 19 insertions, 0 deletions
diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade
index 2152cc2c..479ccd3e 100644
--- a/client/components/settings/settingBody.jade
+++ b/client/components/settings/settingBody.jade
@@ -89,6 +89,9 @@ template(name='email')
li
button.js-save.primary {{_ 'save'}}
+ li
+ button.js-send-smtp-test-email.primary {{_ 'send-smtp-test'}}
+
template(name='accountSettings')
ul#account-setting.setting-detail
li.smtp-form
diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js
index 27f690ee..5b015918 100644
--- a/client/components/settings/settingBody.js
+++ b/client/components/settings/settingBody.js
@@ -125,6 +125,21 @@ BlazeComponent.extendComponent({
},
+ sendSMTPTestEmail() {
+ Meteor.call('sendSMTPTestEmail', (err, ret) => {
+ if (!err && ret) { /* eslint-disable no-console */
+ const message = `${TAPi18n.__(ret.message)}: ${ret.email}`;
+ console.log(message);
+ alert(message);
+ } else {
+ const reason = err.reason || '';
+ const message = `${TAPi18n.__(err.error)}\n${reason}`;
+ console.log(message, err);
+ alert(message);
+ } /* eslint-enable no-console */
+ });
+ },
+
events(){
return [{
'click a.js-toggle-registration': this.toggleRegistration,
@@ -133,6 +148,7 @@ BlazeComponent.extendComponent({
'click a.js-toggle-board-choose': this.checkBoard,
'click button.js-email-invite': this.inviteThroughEmail,
'click button.js-save': this.saveMailServerInfo,
+ 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail,
}];
},
}).register('setting');