HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityLog In

forms/

This topic describes the forms/ folder as it pertains to your application in Optimizely Connect Platform (OCP).

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

Learn more by heading to the 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 would include sender (from/reply addresses), target platform selection, etc. 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 via 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.

Example content-settings.yml 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.

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

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 would include subject line, message body, etc.

This form must contain at least one section and all string data (whether from a free-text input, select box, etc.) 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.

Example content-template.yml 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.

As displayed by the ODP App Campaign Creator.


Next
Did this page help you?