@gravitywelluk/aws
Version:
Library of commonly used AWS wrapper functions to communicate with the AWS SDK
25 lines (24 loc) • 842 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.batchSendEmail = void 0;
const sesv2_configure_1 = require("./sesv2-configure");
const aws_error_1 = require("../utils/aws-error");
/**
* Send a templated email in batch to users
*
* @param {string} template
* @param {Array<{ name: string; email: string }>} toAddresses
* @param {TemplateData} data
* @returns {Promise<AWS.SES.SendBulkTemplatedEmailResponse>}
* @memberof AwsSESService
*/
const batchSendEmail = async (sendBulkParams, configOverrides = {}) => {
const ses = (0, sesv2_configure_1.sesV2Configure)(configOverrides);
try {
return await ses.sendBulkEmail(sendBulkParams).promise();
}
catch (error) {
throw new aws_error_1.AwsError(error);
}
};
exports.batchSendEmail = batchSendEmail;