@tanayvk/mailer
Version:
@adonisjs/mail without @adonisjs/core dependency.
73 lines (72 loc) • 1.6 kB
JavaScript
import {
debug_default
} from "../../chunk-ZF2M7BIF.js";
import {
MailResponse
} from "../../chunk-CRXUSCKP.js";
import {
__name
} from "../../chunk-XE4OXN2W.js";
// src/transports/ses.ts
import nodemailer from "nodemailer";
import SES from "@aws-sdk/client-ses";
var SESTransport = class {
static {
__name(this, "SESTransport");
}
/**
* SES config
*/
/**
* The nodemailer transport
*/
constructor(config) {
this.
}
/**
* Create transporter instance
*/
if (this.
return this.
}
const SESClient = new SES.SES(this.
this.
SES: {
aws: SES,
ses: SESClient
},
sendingRate: this.
maxConnections: this.
});
return this.
}
/**
* Send message
*/
async send(message, options) {
const transporter = this.
const mailOptions = Object.assign({}, message, {
ses: options
});
const sesResponse = await transporter.sendMail(mailOptions);
return new MailResponse(sesResponse.messageId, sesResponse.envelope, sesResponse);
}
/**
* Close transporter connection, helpful when using connections pool
*/
async close() {
if (!this.
return;
}
debug_default("closing ses transport");
this.
this.
}
};
export {
SESTransport
};
//# sourceMappingURL=ses.js.map