UNPKG

@webda/core

Version:

Expose API with Lambda

52 lines 1.18 kB
import { AbstractMailer } from "./mailer.js"; /** * Fake Service to help debug mail expedition * @WebdaModda */ export default class DebugMailer extends AbstractMailer { constructor(webda, name, params) { super(webda, name, params); this.sent = []; this.sent = []; } /** * Fakely send a message saving it to memory to test later on * * @param options * @param callback */ async send(options, _callback = undefined) { this.log("DEBUG", "Send a fake email", options); this.sent.push(options); } /** * Just send a new Error exception */ error() { throw new Error("FakeError"); } /** * Check if the email template exists * * @param name * @returns */ async hasNotification(_name) { // Load template return true; } /** * Just send a new Error exception as async */ async errorAsync() { throw new Error("FakeError"); } /** * Empty async method */ async async() { // Empty on purpose } } export { DebugMailer }; //# sourceMappingURL=debugmailer.js.map