@email-service/email-service
Version:
email-service is a versatile npm package designed to simplify the integration and standardization of email communications across multiple Email Service Providers (ESPs).
25 lines (24 loc) • 1.09 kB
JavaScript
import { normalizeFrom, normalizeRecipients } from "../utils/normalizeEmailRecipients.js";
export class ESP {
constructor(service) {
this.mailMultiple = false;
this.transporter = service;
if (this.transporter.logger)
console.log('******** ES ******** New Instance of ', this.transporter.esp);
}
checkRecipients(to) {
return normalizeRecipients(to);
}
checkFrom(from) {
return normalizeFrom(from);
}
async sendMail(options) {
return ({ success: false, status: 500, error: { name: 'NO_METHOD_sendMail', message: 'This function do never to be call, contact the developper' } });
}
async webHookManagement(req) {
return ({ success: false, status: 500, error: { name: 'NO_METHOD_webHookManagement', message: 'This function do never to be call, contact the developper' } });
}
async sendMailMultiple(options) {
return ([{ success: false, status: 500, error: { name: 'NO_METHOD_sendMail', message: 'This function do never to be call, contact the developper' } }]);
}
}