From dffe3d5ade15582ec71714031509a314a2616667 Mon Sep 17 00:00:00 2001 From: nztqa Date: Mon, 27 Nov 2017 16:44:19 +0900 Subject: Add test SMTP settings --- client/components/settings/settingBody.jade | 3 +++ client/components/settings/settingBody.js | 11 +++++++++++ 2 files changed, 14 insertions(+) (limited to 'client/components/settings') 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..c94f46bb 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -125,6 +125,16 @@ BlazeComponent.extendComponent({ }, + sendSMTPTestEmail() { + Meteor.call('sendSMTPTestEmail', (err, ret) => { + if (!err && ret) { /* eslint-disable no-console */ + console.log('Success:', ret.message, ret.email); + } else { + console.log('Error: Sending test email', err); + } /* eslint-enable no-console */ + }); + }, + events(){ return [{ 'click a.js-toggle-registration': this.toggleRegistration, @@ -133,6 +143,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'); -- cgit v1.2.3-1-g7c22 From 332f12ce2806abcba84eec5b12ea33b26d3a3cd0 Mon Sep 17 00:00:00 2001 From: nztqa Date: Mon, 27 Nov 2017 19:24:06 +0900 Subject: Add alert method --- client/components/settings/settingBody.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/components/settings') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index c94f46bb..e2d0383f 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -129,8 +129,10 @@ BlazeComponent.extendComponent({ Meteor.call('sendSMTPTestEmail', (err, ret) => { if (!err && ret) { /* eslint-disable no-console */ console.log('Success:', ret.message, ret.email); + alert('Success'); } else { console.log('Error: Sending test email', err); + alert(err); } /* eslint-enable no-console */ }); }, -- cgit v1.2.3-1-g7c22 From 44559b52a6d45df57f1ca8eeaae25d55eb7e8148 Mon Sep 17 00:00:00 2001 From: nztqa Date: Tue, 28 Nov 2017 13:26:46 +0900 Subject: Add smtp test email translations --- client/components/settings/settingBody.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'client/components/settings') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index e2d0383f..5b015918 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -128,11 +128,14 @@ BlazeComponent.extendComponent({ sendSMTPTestEmail() { Meteor.call('sendSMTPTestEmail', (err, ret) => { if (!err && ret) { /* eslint-disable no-console */ - console.log('Success:', ret.message, ret.email); - alert('Success'); + const message = `${TAPi18n.__(ret.message)}: ${ret.email}`; + console.log(message); + alert(message); } else { - console.log('Error: Sending test email', err); - alert(err); + const reason = err.reason || ''; + const message = `${TAPi18n.__(err.error)}\n${reason}`; + console.log(message, err); + alert(message); } /* eslint-enable no-console */ }); }, -- cgit v1.2.3-1-g7c22