createTemplate method

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

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

https://atprotodart.com/docs/lexicons/tools/ozone/communication/createTemplate

Implementation

Future<XRPCResponse<TemplateView>> createTemplate({
  required String name,
  required String contentMarkdown,
  required String subject,
  String? lang,
  String? createdBy,
  Map<String, String>? $unknown,
  Map<String, String>? $headers,
  PostClient? $client,
}) async =>
    await _ctx.post<TemplateView>(
      ns.toolsOzoneCommunicationCreateTemplate,
      headers: $headers,
      body: {
        'name': name,
        'contentMarkdown': contentMarkdown,
        'subject': subject,
        if (lang != null) 'lang': lang,
        if (createdBy != null) 'createdBy': createdBy,
        ...?$unknown,
      },
      to: const TemplateViewConverter().fromJson,
      client: $client,
    );