Update password reset to use new nodemailer impl
This commit is contained in:
parent
9cfe71d4c4
commit
f975f7ef85
9 changed files with 220 additions and 102 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue