Allows very simple mail adapters

- Fix nasty bug when updating users email and sending verification
This commit is contained in:
Florent Vilmart
2016-02-27 20:01:12 -05:00
parent 3ecaa0aa4b
commit 2183b0be82
4 changed files with 150 additions and 42 deletions

View File

@@ -1,7 +1,23 @@
/*
Mail Adapter prototype
A MailAdapter should implement at least sendMail()
*/
export class MailAdapter {
sendVerificationEmail(options) {}
sendPasswordResetEmail(options) {}
/*
* A method for sending mail
* @param options would have the parameters
* - to: the recipient
* - text: the raw text of the message
* - subject: the subject of the email
*/
sendMail(options) {}
/* You can implement those methods if you want
* to provide HTML templates etc...
*/
// sendVerificationEmail({ link, appName, user }) {}
// sendPasswordResetEmail({ link, appName, user }) {}
}
export default MailAdapter;