The options object

Only available within a task, the options object contains all values provided by merchants while configuring the task.

Each option value is itself parsed for Liquid. The options variable is not available during this pass. :)

How to access it

What it contains

This object is always a hash. The keys are determined by usages in the script (and possibly in Liquid event subscriptions).

For example, let's look at this script:

{% if options.send_email__boolean %}
    "action": {
      "type": "email",
      "options": {
        "subject": {{ options.email_subject | json }}
{% endif %}

Mechanic scans this script ahead of time, and generates an options object that looks like this:

  "send_email__boolean": false,
  "email_subject": null

The task interface will present the merchant with fields for configuring these options to their liking.

To learn more about how the task script interacts with options, read our introduction to scripts.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.