Flavonto Forms documentation, version 1.0.0

Developers

The form document

The JSON structure of a form, as exported, imported and passed to hooks.

A form export (Import and export) is a JSON object with format: "flavonto-forms", the export format version (1), the plugin version that made it, the form title and its doc. Hooks receive the same doc array.

{
  "schemaVersion": 1,
  "settings": { "title": "Contact us", "showTitle": true, "preset": "clear", "...": "..." },
  "pages": [
    {
      "id": "p_main01",
      "type": "page",
      "title": "",
      "children": [
        { "id": "f_name01", "type": "name", "name": "name", "label": "Your name", "required": true },
        {
          "id": "f_topic1",
          "type": "radio",
          "name": "topic",
          "label": "What is it about?",
          "options": [ { "label": "Sales", "value": "sales" }, { "label": "Support", "value": "support" } ]
        },
        {
          "id": "f_order1",
          "type": "text",
          "name": "order",
          "label": "Order number",
          "logic": {
            "action": "show",
            "match": "all",
            "groups": [ { "match": "all", "rules": [ { "field": "f_topic1", "op": "is", "value": "support" } ] } ]
          }
        },
        { "id": "f_send01", "type": "submit", "text": "Send" }
      ]
    }
  ],
  "notifications": [ { "id": "n_team0001", "name": "Team", "trigger": "submitted", "subject": "New: {field:name}", "...": "..." } ],
  "confirmations": [ { "id": "c_thanks01", "type": "message", "message": "<p>Thank you.</p>", "...": "..." } ],
  "integrations": [ { "id": "i_webhook1", "type": "webhook", "enabled": true, "config": { "...": "..." } } ],
  "payment": { "enabled": false, "providers": [ "stripe" ], "amountSource": "fixed", "currency": "USD", "...": "..." }
}

Rules

Documents are sanitised when saved: unknown keys are dropped, HTML in rich text is limited to safe tags for people without the unfiltered_html capability, and the builder's Check lists anything that blocks publishing. Older documents are upgraded on load (flvf_upgrade_document).