@goldstack/template-email-send
Version:
Utilities for packages that implement email sending using AWS SES
36 lines • 1.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSESClient = exports.getMockedSES = exports.getFromDomain = exports.connect = void 0;
exports.getSentEmailRequests = getSentEmailRequests;
var sesConnect_1 = require("./sesConnect");
Object.defineProperty(exports, "connect", { enumerable: true, get: function () { return sesConnect_1.connect; } });
Object.defineProperty(exports, "getFromDomain", { enumerable: true, get: function () { return sesConnect_1.getFromDomain; } });
Object.defineProperty(exports, "getMockedSES", { enumerable: true, get: function () { return sesConnect_1.getMockedSES; } });
const utils_esbuild_1 = require("@goldstack/utils-esbuild");
/**
* Creates an SES (Simple Email Service) client.
*
* This function returns an SES client instance. If a client is provided as an argument,
* it will be used; otherwise, a new client will be created using the mocked SES module.
*
* @param {SESClient} [sesClient] - An optional SES client instance to use.
* @returns {SESClient} The SES client instance.
*/
const createSESClient = (sesClient) => {
const createSESClient = require((0, utils_esbuild_1.excludeInBundle)('./mockedSES')).createSESClient;
return createSESClient(sesClient);
};
exports.createSESClient = createSESClient;
/**
* Retrieves the list of email send requests that have been sent using the provided SES client.
*
* This function accesses the internal `_goldstackSentRequests` property of the SES client
* to return the list of email requests that have been sent.
*
* @param {SESClient} sesClient - The SES client instance from which to retrieve sent email requests.
* @returns {SendEmailRequest[]} An array of `SendEmailRequest` objects representing the sent emails.
*/
function getSentEmailRequests(sesClient) {
return sesClient._goldstackSentRequests;
}
//# sourceMappingURL=templateEmailSend.js.map