Introduction
The Confirmations object is an associative array containing the properties for all the confirmations which exist for a form. When a new form is created a single confirmation, named Default Confirmation, is created. There is no limit to the number of additional confirmations you can create but they must have conditional logic configured.
See the Configuring Confirmations article for a tutorial showing how you can configure confirmations in the admin.
$form['confirmations'] = array(
'5acf8e9cf310a' => array(
'id' => '5acf8e9cf310a',
'name' => 'Default Confirmation',
'isDefault' => true,
'type' => 'message',
'message' => 'Thanks for contacting us! We will get in touch with you shortly.',
'url' => '',
'pageId' => '',
'queryString' => '',
),
);
Usage
The confirmations are part of the Form Object and so are most commonly accessed like so:
$confirmations = rgar( $form, 'confirmations' );
Confirmation Properties
Prop | Type | Description |
---|---|---|
id | string | The confirmation ID. A 13 character unique ID generated by the PHP uniqid function. |
name | string | The confirmation name. |
isDefault | boolean | Indicates if this is the default confirmation created on form creation or one of the automatically created confirmations for the save and continue feature. |
type | string | Determines the type of confirmation to be used. Possible values: message : displays a simple messagepage : redirects to a WordPress post or pageredirect : redirects to an external URL |
message | null|string | Only used when type is message .The message to be displayed when the form submission completes. |
disableAutoformat | null|boolean | Only used when type is message .Determines if the formatting of new lines in the message as paragraphs should be disabled. |
pageId | null|integer|string | Only used when type is page .The ID of the post or page to redirect to when the form submission completes. |
url | null|string | Only used when type is redirect .The URL to redirect to when the form submission completes. |
queryString | null|string | Only used when type is page or redirect .The query string to be appended to the redirect URL. Merge tags supported. |
conditionalLogic | null|array | Not used when isDefault is true or when event is defined.An associative array containing the conditional logic rules. See the Conditional Logic Object for more details. |
event | null|string | The non-submission event the confirmation is to be used for. Possible values: null or an empty string to indicate the confirmation is used on form submission completion.form_saved : displayed when the save and continue later link is used.form_save_email_sent : displayed when the email link form in the form_saved confirmation message triggered sending of the resume email notification. |
isActive | null|boolean | Not used when isDefault is true or when event is defined.Indicates the confirmation status, active or inactive. Default: true |