createInAppTemplate method

Future<CreateInAppTemplateResponse> createInAppTemplate({
  1. required InAppTemplateRequest inAppTemplateRequest,
  2. required String templateName,
})

Creates a new message template for messages using the in-app message channel.

May throw BadRequestException. May throw ForbiddenException. May throw InternalServerErrorException. May throw MethodNotAllowedException. May throw TooManyRequestsException.

Parameter templateName : The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.

Implementation

Future<CreateInAppTemplateResponse> createInAppTemplate({
  required InAppTemplateRequest inAppTemplateRequest,
  required String templateName,
}) async {
  final response = await _protocol.sendRaw(
    payload: inAppTemplateRequest,
    method: 'POST',
    requestUri: '/v1/templates/${Uri.encodeComponent(templateName)}/inapp',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return CreateInAppTemplateResponse(
    templateCreateMessageBody: TemplateCreateMessageBody.fromJson($json),
  );
}