UNPKG

@gravitywelluk/aws

Version:

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

23 lines (22 loc) 729 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEmailTemplateByName = void 0; const sesv2_configure_1 = require("./sesv2-configure"); const aws_error_1 = require("../utils/aws-error"); /** * gets a template by name * * @param name string * @returns promise with the output * @memberof AwsSESService */ const getEmailTemplateByName = async (name, configOverrides = {}) => { const ses = (0, sesv2_configure_1.sesV2Configure)(configOverrides); try { return await ses.getEmailTemplate({ TemplateName: name }).promise(); } catch (error) { throw new aws_error_1.AwsError(error); } }; exports.getEmailTemplateByName = getEmailTemplateByName;