testRenderEmailTemplate method
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 NotFoundException. May throw TooManyRequestsException. May throw BadRequestException.
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<TestRenderEmailTemplateResponse> testRenderEmailTemplate({
required String templateData,
required String templateName,
}) async {
ArgumentError.checkNotNull(templateData, 'templateData');
_s.validateStringLength(
'templateData',
templateData,
0,
262144,
isRequired: true,
);
ArgumentError.checkNotNull(templateName, 'templateName');
_s.validateStringLength(
'templateName',
templateName,
1,
1152921504606846976,
isRequired: true,
);
final $payload = <String, dynamic>{
'TemplateData': templateData,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v2/email/templates/${Uri.encodeComponent(templateName)}/render',
exceptionFnMap: _exceptionFns,
);
return TestRenderEmailTemplateResponse.fromJson(response);
}