Files
kami-parse-server/spec/MockEmailAdapterWithOptions.js
Florent Vilmart e30989c7d3 Lookup for email in username field to match docs if email is undefined (#2732)
* Lookup for email in username field to match docs if email is undefined

* Adds support for sendMail option to when email is selected

* Proper does not exists clause
2016-09-18 18:32:34 -04:00

22 lines
548 B
JavaScript

module.exports = options => {
if (!options) {
throw "Options were not provided"
}
let adapter = {
sendVerificationEmail: () => Promise.resolve(),
sendPasswordResetEmail: () => Promise.resolve(),
sendMail: () => Promise.resolve()
};
if (options.sendMail) {
adapter.sendMail = options.sendMail
}
if (options.sendPasswordResetEmail) {
adapter.sendPasswordResetEmail = options.sendPasswordResetEmail
}
if (options.sendVerificationEmail) {
adapter.sendVerificationEmail = options.sendVerificationEmail;
}
return adapter;
}