Update password reset to use new nodemailer impl

This commit is contained in:
Calvin Montgomery 2017-09-26 21:22:15 -07:00
parent 9cfe71d4c4
commit f975f7ef85
9 changed files with 220 additions and 102 deletions

View file

@ -1,12 +1,36 @@
class EmailConfig {
constructor(config) {
constructor(config = { 'password-reset': { enabled: false }, smtp: {} }) {
this.config = config;
}
getPasswordReset() {
const reset = this.config['password-reset'];
const smtp = config.smtp;
this._smtp = {
getHost() {
return smtp.host;
},
getPort() {
return smtp.port;
},
isSecure() {
return smtp.secure;
},
getUser() {
return smtp.user;
},
getPassword() {
return smtp.password;
}
}
const reset = config['password-reset'];
this._reset = {
isEnabled() {
return reset.enabled;
},
return {
getHTML() {
return reset['html-template'];
},
@ -16,14 +40,22 @@ class EmailConfig {
},
getFrom() {
return reset['from'];
return reset.from;
},
getSubject() {
return reset['subject'];
return reset.subject;
}
};
}
getSmtp() {
return this._smtp;
}
getPasswordReset() {
return this._reset;
}
}
export { EmailConfig };