createEmailTemplate method

Future<void> createEmailTemplate({
  1. required EmailTemplateContent templateContent,
  2. required String templateName,
})

Creates an email template. Email templates enable you to send personalized email to one or more destinations in a single API operation. For more information, see the Amazon SES Developer Guide.

You can execute this operation no more than once per second.

May throw AlreadyExistsException. May throw TooManyRequestsException. May throw BadRequestException. May throw LimitExceededException.

Parameter templateContent : The content of the email template, composed of a subject line, an HTML part, and a text-only part.

Parameter templateName : The name of the template you want to create.

Implementation

Future<void> createEmailTemplate({
  required EmailTemplateContent templateContent,
  required String templateName,
}) async {
  ArgumentError.checkNotNull(templateContent, 'templateContent');
  ArgumentError.checkNotNull(templateName, 'templateName');
  _s.validateStringLength(
    'templateName',
    templateName,
    1,
    1152921504606846976,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'TemplateContent': templateContent,
    'TemplateName': templateName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v2/email/templates',
    exceptionFnMap: _exceptionFns,
  );
}