Schema for Cleo Message Template Set User Variables

From MessageTemplateSetUserVariables.schema.yaml (cleo/MessageTemplateSetUserVariables.schema)

---
$id: https://skeleton.botmd.io/cleo/MessageTemplateSetUserVariables.schema
$schema: http://json-schema.org/draft-07/schema#

title: Message Template Set User Variables
description: List of variables that a user can specify on the frontend for messaging patients.

type: array
minItems: 0
items:
  type: object
  additionalProperties: false
  required: [name, description]

  properties:
    name:
      title: Name
      description: Variable name that will be used for substitution. Name should not include the `${` and `}` prefix/suffix.
      type: string
      pattern: '^[a-zA-Z0-9\-\_\[\]\(\)\{\}]+$'
    #end name

    description:
      title: Description
      description: Human readable description used as a prompt on frontend for user data entry.
      type: string
      minLength: 1
    #end description

    type:
      title: Type
      description: The type of this variable. Defaults to `string`.
      enum: [string, file, url, datetime, date, time]
    #end type

    required:
      title: Required
      description: Whether this variable is required. Defaults to `false`.
      type: boolean
    #end required

    default:
      title: Default
      description: If this variable is not required, the `default` value will be used. Defaults to not being included in the `variables`.
      type: string
      minLength: 1
    #end default

    max_length:
      title: Max Length
      description: For `string` and `url`, this is the maximum length of the string.
      type: integer
      minimum: 1
    #end max_length

    datetime_format:
      title: "`strftime` Format"
      description: >-
        For `datetime`, `date`, and `time` variables, the `strftime` will be applied to generate the final string.
        Defaults to clinic settings `datetime_format` for `date` and `datetime`.
        This is required for `time` variables.

        See [Python strftime style format](https://strftime.org/) for more information.

        Note: __Named `datetime_format` to be consistent with clinic settings but can be used for both `date` and `time` variable types as well.__

      type: string
      minLength: 1
    #end datetime_format
  #end properties
#end items

[Main Page] [Schema Documentation] [Examples]