toolsOzoneCommunicationCreateTemplate function

Future<XRPCResponse<TemplateView>> toolsOzoneCommunicationCreateTemplate({
  1. required String name,
  2. required String contentMarkdown,
  3. required String subject,
  4. String? lang,
  5. String? createdBy,
  6. required ServiceContext $ctx,
  7. Map<String, String>? $headers,
  8. Map<String, String>? $unknown,
})

Administrative action to create a new, re-usable communication (email for now) template.

Implementation

Future<XRPCResponse<TemplateView>> toolsOzoneCommunicationCreateTemplate({
  required String name,
  required String contentMarkdown,
  required String subject,
  String? lang,
  String? createdBy,
  required ServiceContext $ctx,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.toolsOzoneCommunicationCreateTemplate,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    'name': name,
    'contentMarkdown': contentMarkdown,
    'subject': subject,
    if (lang != null) 'lang': lang,
    if (createdBy != null) 'createdBy': createdBy,
  },
  to: const TemplateViewConverter().fromJson,
);