Refactor and advancements
- Drops mailController, centralized in UserController - Adds views folder for change_password - Improves PromiseRouter to support text results - Improves PromiseRouter to support empty responses for redirects - Adds options to AdaptableController - UsersController gracefully fails when no adapter is set - Refactors GlobalConfig into same style for Routers
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export class MailAdapter {
|
||||
sendVerificationEmail(options) {}
|
||||
sendPasswordResetEmail(options) {}
|
||||
sendMail(options) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,19 @@ let SimpleMailgunAdapter = mailgunOptions => {
|
||||
text: verifyMessage
|
||||
});
|
||||
},
|
||||
|
||||
sendPasswordResetEmail: ({link,user, appName}) => {
|
||||
let message =
|
||||
"Hi,\n\n" +
|
||||
"You requested to reset your password for " + appName + ".\n\n" +
|
||||
"" +
|
||||
"Click here to reset it:\n" + link;
|
||||
return sendMail({
|
||||
to:user.email,
|
||||
subject: 'Password Reset for ' + appName,
|
||||
text: message
|
||||
});
|
||||
},
|
||||
sendMail: sendMail
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user