On Your Site
Local Development
Site Code
Guides
Site Configuration
Content Management
Forms
Form API
Templates
Forms
Form Options
Not all options apply to all types of forms.
queryStringCapture
This option is used to collect parameters from the query string. In order to ensure Dijon Platform is as efficient as possible the capture of these query strings in done in Javascript. The data from this option are passed to Dijon Platform's built in Form API Javascript where the query string parameters are captured to be submitted alongside the other data from the form.
The options accepts an array of options. The value of the array is the name of the field the query string parameter should be copied into, the key is the query string parameter name to capture.
If you were to specify the following...
$config->addForm([
...
'queryStringCapture' => [
'source' => 'utm_source'
]
...
])
This would copy the query string parameter utm_source to the field source.
If you are not using the supplied Form API Javacript you will need to
access this option yourself using the form_data
Twig function.
mailMergeFields
This option allows you to pass form fields to Mandrill emails. If set, they will
appear in Mailchip surrounded by *||*
, e.g. utm_source
results in
*|utm_source|*
being available in your Mandrill template.
$config->addForm([
...
'mailMergeFields' => [
'utm_approach_code',
'utm_source',
'utm_medium',
'utm_content',
'utm_term',
'utm_campaign',
'variant'
]
...
])
marketingConsent
This options allows you to explicity collect email marketing consent from your form. This information is used by Dijon when pushing data to integrations that require marketing consent is specified. Use this to specify exactly which form key and values means that you have marketing consent.
$config->addForm([
...
'marketingConsent' => [
'field' => 'opt_in',
'consent_if' => 'yes'
]
...
]);
In this example the field
value specifies the form field to use. The
consent_if
tells Dijon Platform that consent is given if the value of field
is the value specified in consent_if
. In this case if a form field of opt_in
was yes
the donor would be marked as have giving consent for marketing,
otherwise it defaults to consent having not been given.
$config->addForm([
...
'marketingConsent' => [
'field' => 'opt_in',
'no_consent_if' => 'no'
]
...
]);
In this example the field
value specifies the form field to use. The
no_consent_if
tells Dijon Platform that consent is not given if the value of
field
is the value specified in no_consent_if
. In this case if a form field
of opt_in
was no
the donor would be marked as have not giving consent for
marketing, otherwise it defaults to consent having been given.