testRenderTemplate method

Future<TestRenderTemplateResponse> testRenderTemplate({
  1. required String templateData,
  2. required String templateName,
})

Creates a preview of the MIME content of an email when provided with a template and a set of replacement data.

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

May throw TemplateDoesNotExistException. May throw InvalidRenderingParameterException. May throw MissingRenderingAttributeException.

Parameter templateData : A list of replacement values to apply to the template. This parameter is a JSON object, typically consisting of key-value pairs in which the keys correspond to replacement tags in the email template.

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

Implementation

Future<TestRenderTemplateResponse> testRenderTemplate({
  required String templateData,
  required String templateName,
}) async {
  ArgumentError.checkNotNull(templateData, 'templateData');
  _s.validateStringLength(
    'templateData',
    templateData,
    0,
    262144,
    isRequired: true,
  );
  ArgumentError.checkNotNull(templateName, 'templateName');
  final $request = <String, dynamic>{};
  $request['TemplateData'] = templateData;
  $request['TemplateName'] = templateName;
  final $result = await _protocol.send(
    $request,
    action: 'TestRenderTemplate',
    version: '2010-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['TestRenderTemplateRequest'],
    shapes: shapes,
    resultWrapper: 'TestRenderTemplateResult',
  );
  return TestRenderTemplateResponse.fromXml($result);
}