1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

New SMTP library and refactoring of mailer code

This commit is contained in:
sauls8t 2018-03-07 18:52:19 +00:00
parent 99220641f3
commit bd43319bb2
39 changed files with 3163 additions and 1268 deletions

View file

@ -17,8 +17,10 @@ export default Component.extend({
SMTPHostEmptyError: empty('model.smtp.host'),
SMTPPortEmptyError: empty('model.smtp.port'),
SMTPSenderEmptyError: empty('model.smtp.sender'),
SMTPUserIdEmptyError: empty('model.smtp.userid'),
SMTPPasswordEmptyError: empty('model.smtp.password'),
senderNameError: empty('model.smtp.senderName'),
buttonText: 'Save & Test',
testSMTP: null,
actions: {
saveSMTP() {
@ -34,16 +36,22 @@ export default Component.extend({
$("#smtp-sender").focus();
return;
}
if (this.get('SMTPUserIdEmptyError')) {
$("#smtp-userid").focus();
return;
}
if (this.get('SMTPPasswordEmptyError')) {
$("#smtp-password").focus();
if (this.get('senderNameError')) {
$("#smtp-senderName").focus();
return;
}
this.get('saveSMTP')().then(() => {
this.set('testSMTP', {
success: true,
message: ''
},
);
this.set('buttonText', 'Please wait...');
this.get('saveSMTP')().then((result) => {
this.set('buttonText', 'Save & Test');
this.set('testSMTP', result);
});
}
}