🖼️
KASKO Frontend Documentation
  • README
  • Getting started
    • Setting up a new webapp
    • Webapp manifest
    • Building the flow
    • Defining layouts
    • Defining computed values
    • Defining dynamic paths
  • Core concepts
    • Forms
    • Validation
      • Using existing validators
      • Adding custom validators
    • Configuration
      • Price format
      • Date format
    • Performing API calls
    • Toggling visibility of components
    • Translations
    • Rules For Robust Application
  • Guides
    • Using logical statements (JsonLogic)
    • Adding discount codes
    • Developing Custom Plugins
    • Setting required requests
    • Adding save quote for later
    • Transforming request data
    • Manifest merging strategy
    • Knockout flow
    • Local pricing logic
    • Setting up dashboard policy profile
    • Handling offers
    • Repeater
  • Snippets
    • Reset input state
  • Useful resources
    • All component descriptions
    • JsonLogic core documentation
    • Kasko.js documentation
    • Example webapp
    • Example plugins (w/ various frameworks)
Powered by GitBook
On this page
  • Querystring prefill
  • Lead Challenge
  • Field definition
  • Challenge screen flow manifest
  • Initial screen definition
  • Email template
  • Contents
  1. Guides

Adding save quote for later

There are two ways of implementing this feature. One is slightly more complex than the other.

  1. Querystring prefill

  2. Lead Challenge

Querystring prefill

The most simple and straightforward solution is to prefill the webapp via querystring parameters. This can be achieved via providing all of the customer's input in the email template.

This method CANNOT be used if there are a lot of variables as it will build a long URL that some browsers cannot handle.

{%
set dataObject = {
  'email': lead.quote.data.email,
  'first_name': lead.quote.data.first_name,
  'last_name': lead.quote.data.last_name
}

set leadUrl = "https://integration-url.com/?kdata=" ~ { 'data': dataObject } | kdata
%}

<a href="{{ leadUrl }}">Open webapp</a>

Lead Challenge

Using lead challenge is a much more versatile way of retrieving lead data. Though it requires more work up front.

Field definition

First, the webapp must know that a "challenge" exists for this product and the fields associated with the challenge. This can be done by defining the lead_challenge field definition.

{
  "lead_challenge": [
    {
      "path": null,
      "name": "access_pin",
      "validation": "required|string|size:8"
    }
  ]
}

Challenge screen flow manifest

Next, a screen where the customer will be able to provide their challenge information (fields) must be created.

{
  "path": "access-pin",
  "components": [
    {
      "type": "title",
      "config": {
        "content_key": "flow.access_pin.title"
      }
    },
    {
      "type": "form",
      "config": {
        "components": [
          {
            "type": "form-input",
            "config": {
              "show_label": true,
              "field_name": "access_pin"
            }
          },
          {
            "type": "error-list"
          }
        ],
        "footer_components": [
          {
            "type": "form-button-next"
          }
        ]
      }
    }
  ],
  "next": {
    "type": "jsonlogic",
    "schema": {
      "if": [
        {
          "===": [
            {
              "var": "flags.lead_token_valid"
            },
            true
          ]
        },
        "summary",
        "welcome"
      ]
    }
  }
}

Initial screen definition

The initial screen must be set to the challenge screen if lead_token_valid flag exists.

{
  "type": "jsonlogic",
  "schema": {
    "if": [
      {
        "===": [
          {
            "var": "flags.lead_token_valid"
          },
          true
        ]
      },
      "access-pin",
      "welcome"
    ]
  }
 }

Email template

The feature must be enabled in the email template via lead.token.

{%
set leadUrl = "https://integration-url.com/?kdata=" ~ { 'config': { lead_token: lead.token } } | kdata
%}

<a href="{{ leadUrl }}">Open webapp</a>

Contents

Finally, don't forget to set the new contents.

"flow.access_pin.title","Please provide your PIN"
"form.access_pin.label","PIN"
"form.access_pin.placeholder","xxxxxxxx"
"form.access_pin.errors.required","This field is required"
"form.access_pin.errors.size","This field must be exactly 8 characters long"
"form.access_pin.errors.invalid_value","Invalid Access pin provided. Please try again."

Last updated 9 months ago