AWS Code Sample
Catalog

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

get_template.cpp

get_template.cpp demonstrates how to retrieve an Amazon SES email template.

/* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. This file is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <aws/core/Aws.h> #include <aws/email/SESClient.h> #include <aws/email/model/GetTemplateRequest.h> #include <aws/email/model/GetTemplateResult.h> #include <iostream> int main(int argc, char **argv) { if (argc != 2) { std::cout << "Usage: get_template <template_name>"; return 1; } Aws::SDKOptions options; Aws::InitAPI(options); { Aws::String template_name(argv[1]); Aws::SES::SESClient ses; Aws::SES::Model::GetTemplateRequest gt_req; gt_req.SetTemplateName(template_name); auto gt_out = ses.GetTemplate(gt_req); if (gt_out.IsSuccess()) { std::cout << "Successfully get template" << std::endl; } else { std::cout << "Error getting template" << gt_out.GetError().GetMessage() << std::endl; } } Aws::ShutdownAPI(options); return 0; }

Sample Details

Service: ses

Author: tapasweni-pathak

Type: full-example

On this page: