// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // ABOUT THIS NODE.JS SAMPLE: This sample is part of the SDK for JavaScript Developer Guide topic at // https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/ses-examples-creating-template.html // snippet-start:[ses.JavaScript.templates.getTemplate] // Load the AWS SDK for Node.js. var AWS = require("aws-sdk"); // Set the AWS Region. AWS.config.update({ region: "REGION" }); // Create the promise and Amazon Simple Email Service (Amazon SES) service object. var templatePromise = new AWS.SES({ apiVersion: "2010-12-01" }) .getTemplate({ TemplateName: "TEMPLATE_NAME" }) .promise(); // Handle promise's fulfilled/rejected states templatePromise .then(function (data) { console.log(data.Template.SubjectPart); }) .catch(function (err) { console.error(err, err.stack); }); // snippet-end:[ses.JavaScript.templates.getTemplate]