Contact Form Smarty Functions

Contact Form Smarty Functions refers specifically to methods by which you can add content to Contact Forms.

This article provides details about the functions you have access to, their parameters and how to use them.

Overview

The functions described in this article allow you to place content into Contact Forms templates.
Google ReCaptcha


Requirements

In order for this to work, you must have completed the Google ReCaptcha integration process.

Placement

To render Google ReCaptcha form content into your Contact Forms template, place the following code snippet into your form.

{google_recaptcha form="contact_us" id='google_recaptcha_contactus'}

❗️

Parameter id must be always included and its value to be equal to google_recaptcha_contactus otherwise validation won't work properly!

Accepted Parameters

ParameterValuesDefaultDescriptionRequired
idStringgoogle_recaptchaValue of ID attribute used to identify the widget when ReCaptcha renders.No
classStringg-recaptchaValue of CLASS attribute of the DIV placeholder. This can be used to tweak the position of the placeholder using CSS.No
labelfalse | truetrueIf set to true, then LABEL for the form input will be shown, otherwise it will be hidden.

This parameter should be set without quotes e.g. label=true
No
titleStringGoogle ReCaptchaText displayed inside LABEL form element.No
pageStringContact UsName of the page (category) of the piece of Site Text which will be used for translation of the text set in title parameter.No
errorfalse | truetrueIf set to true, then errors will be displayed

This parameters should be set without quotes. e.g. error=true
No
error_textStringGoogle ReCaptcha required.Text shown when user submits the form without doing ReCaptcha
error_classStringtemplate_form_label_error_descriptionValue of CLASS attribute of the errors DIV containerNo
site_keyStringDefault Google ReCaptcha Site Key set in Aurora StoreTo configure default Google ReCaptcha Site Key which will be used throughout the store go to Aurora > Store > Settings > Feeds > Google ReCaptcha or consult with Google ReCaptcha article for more information.

This parameter is for development/testing purposes only and should not be used on production environment.
No
formStringNoneThis will determine Which version of the Google ReCaptcha widget to render based on your Google ReCaptcha integration settings, please see Google ReCaptcha for more information.

Valid values:

contact_us
newsletter
track_order
validate_gift_card
* user_exists



You must also set the corresponding version of the init process i.e.

<br>{google_recaptcha_init form="contact_us"}<br>
No
actionStringNoneOnly sent to Google when using ReCaptcha v3.No

Customisation

If for some reason the content rendered from the function doesn't meet your requirements, you can use the absolute code minimum required use Google ReCaptcha as follows:

Getting minimum required code

{google_recaptcha form="contact_us" id='google_recaptcha_contactus' label=false error=false}

If you need to get value of Google ReCaptcha Site key directly in your template you can use the following code snippet:

Get Google ReCaptcha Site key

{$config.gc_recaptcha_site_key}