UNPKG

@gravitywelluk/aws

Version:

Library of commonly used AWS wrapper functions to communicate with the AWS SDK

24 lines (23 loc) 699 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sendEmail = void 0; const sesv2_configure_1 = require("./sesv2-configure"); const aws_error_1 = require("../utils/aws-error"); /** * sends a templated email * * @param fileName string * @param body any * @returns promise with the output * @memberof AwsSESService */ const sendEmail = async (sendEmailParams, configOverrides = {}) => { const ses = (0, sesv2_configure_1.sesV2Configure)(configOverrides); try { return await ses.sendEmail(sendEmailParams).promise(); } catch (error) { throw new aws_error_1.AwsError(error); } }; exports.sendEmail = sendEmail;