2024-03-20 12:46:39 +01:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2021-06-25 14:46:02 +02:00
|
|
|
module SendgridMock {
|
|
|
|
class Email {
|
|
|
|
constructor() {
|
|
|
|
// @ts-ignore
|
|
|
|
this.apiKey = null
|
|
|
|
}
|
|
|
|
|
|
|
|
setApiKey(apiKey: any) {
|
|
|
|
// @ts-ignore
|
|
|
|
this.apiKey = apiKey
|
|
|
|
}
|
|
|
|
|
|
|
|
async send(msg: any) {
|
2024-02-08 17:32:14 +01:00
|
|
|
if (msg.to === "invalid@example.com") {
|
2021-06-25 14:46:02 +02:00
|
|
|
throw "Invalid"
|
|
|
|
}
|
|
|
|
return msg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = new Email()
|
|
|
|
}
|