Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDevCommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

forms/

The forms/ folder in Optimizely Connect Platform (OCP) applications contains settings and content files where you define how settings forms display and function for users.

settings.yml

The settings.yml file defines the structure of the form that an end-user sees when configuring your app.

Best practices

Items to include in your settings:

  • Collection of authentication information
  • Configuration of logic (for example, which data to import)
  • Starting a historical bulk import

For more information, see Form Basics.

content-settings.yml

📘

Note

Required for Channel apps only.

The content-settings.yml file defines the settings form of an app's channel interface. It exists at the touchpoint level (for example, shared between messages involved in content testing). Typical content for this form includes sender (from/reply addresses), target platform selection, and so on. If none of this is required, the form may simply contain no sections.

This form may contain as many sections as desired, but all configured content is considered to be static (there is no support for personalization using Optimizely Data Platform (ODP) liquid anywhere in this form). If an app uses dynamic targeting (see App SDK documentation), this form must contain all necessary information to determine the targeting details.

Below is an example of the content-settings.yml file from the API Channel App:

sections:
  - key: target
    label: Targeting
    elements:
      - key: identifier
        label: Target Identifier
        type: select
        help: Select an ODP Identifier for targeting
        required: true
        dataSource:
          type: app
          function: list_identifiers
  - key: headers
    label: Headers
    elements:
      - key: h1_key
        label: Header Name 1
        help: Header name (for example, Content-Type)
        type: text
        hint: Content-Type
        defaultValue: Content-Type
      - key: h1_value
        label: Header Value 1
        help: Header value (for example, application/json)
        type: text
        hint: application/json
        defaultValue: application/json
      - key: h2_key
        label: Header Name 2
        help: Header name (for example, Content-Type)
        type: text
        hint: Content-Type
      - key: h2_value
        label: Header Value 2
        help: Header value (for example, application/json)
        type: text
        hint: Content-type
The above example yml as displayed in the ODP App Campaign Creator.

The above example yml as displayed in the ODP App Campaign Creator.

For more information, see Form Basics.

content-template.yml

📘

Note

Required for Channel apps only.

The content-template.yml file defines the template form of an app's channel interface. It exists at the individual message level. Typical content for this form includes subject line, message body, and so on.

This form must contain at least one section and all string data (whether from a free-text input, select box, or other) is eligible for personalization via ODP liquid. The value of each string field is translated into a simple substitution format, where personalized blocks are denoted by text of the form %%variable%%. The variable names are generated by the translation process and the complete set of variable names is provided to the app for reference along with the translated content during the publish phase. Personalized substitutions are provided during the deliver calls to be inserted in place of the substitution variables.

Below is an example of the content-template.yml file from the API Channel App:

sections:
  - key: request
    label: Request
    elements:
      - key: method
        label: API Method
        help: API Call Method (for example, POST or GET)
        type: select
        options:
          - value: GET
            text: GET
          - value: POST
            text: POST
          - value: PUT
            text: PUT
          - value: PATCH
            text: PATCH
          - value: DELETE
            text: DELETE
        hint: Content-Type
        defaultValue: Content-Type
      - key: url
        type: text
        label: URL
        help: HTTP URL to deliver to
        required: true
        validations:
          - regex: "^https?:\\/\\/"
            message: Must be an http or https url
      - key: body
        type: text
        label: Body Content
        help: Post Body
        multiline: true
        defaultValue: "{}"
        visible:
          operation: any
          comparators:
            - key: method
              equals: 'POST'
            - key: method
              equals: 'PUT'
            - key: method
              equals: 'PATCH'
As displayed by the ODP App Campaign Creator.

As displayed by the ODP App Campaign Creator.

For more information, see Form Basics.