18 lines
252 B
JavaScript
18 lines
252 B
JavaScript
class Email {
|
|
constructor() {
|
|
this.apiKey = null
|
|
}
|
|
|
|
setApiKey(apiKey) {
|
|
this.apiKey = apiKey
|
|
}
|
|
|
|
async send(msg) {
|
|
if (msg.to === "invalid@test.com") {
|
|
throw "Invalid"
|
|
}
|
|
return msg
|
|
}
|
|
}
|
|
|
|
module.exports = new Email()
|