Skip to content

Commit

Permalink
fix port is string
Browse files Browse the repository at this point in the history
  • Loading branch information
yurikuzn committed Mar 9, 2024
1 parent 0dd34df commit 0832faa
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions client/src/views/admin/outbound-emails.js
Expand Up @@ -124,20 +124,19 @@ define('views/admin/outbound-emails', ['views/settings/record/edit'], function (
afterRender: function () {
Dep.prototype.afterRender.call(this);

var smtpSecurityField = this.getFieldView('smtpSecurity');
this.listenTo(smtpSecurityField, 'change', function () {
var smtpSecurity = smtpSecurityField.fetch()['smtpSecurity'];
if (smtpSecurity == 'SSL') {
this.model.set('smtpPort', '465');
} else if (smtpSecurity == 'TLS') {
this.model.set('smtpPort', '587');
const smtpSecurityField = this.getFieldView('smtpSecurity');

this.listenTo(smtpSecurityField, 'change', () => {
const smtpSecurity = smtpSecurityField.fetch()['smtpSecurity'];

if (smtpSecurity === 'SSL') {
this.model.set('smtpPort', 465);
} else if (smtpSecurity === 'TLS') {
this.model.set('smtpPort', 587);
} else {
this.model.set('smtpPort', '25');
this.model.set('smtpPort', 25);
}
}.bind(this));
});
},

});

});

0 comments on commit 0832faa

Please sign in to comment.