Contact Forms
Aurora allows you to submit forms that can be distributed to the relevant people within your organisation, for example "Contact Us" pages.
This article describes how to utilise the form mechanisms within Aurora and how the resulting emails can be configured.
Introduction
Aurora allows you to submit forms that can be distributed to the relevant people within your organisation. This information is stored under Orders > Enquiries, so you can view it later on.
Who receives the submissions?
You can set this via Store > Settings > Email Notification > Contact Notification
What email is sent out?
The content will be emailed to the recipients set up in the above question, as well as the person submitting the form, providing that Store > Settings > Enabled Auto Responders is ticked.
The content of the email is controlled by the following sources:
- templates/your_templates_dir/emails/contactus.tpl.html
- templates/your_templates_dir/emails/leaveamessage.tpl.html
- The Order Email found in the Aurora Back-end under Orders > Emails and configured as a "leave a message" email.
The content for this email is checked for in each of the above in the order they are listed. Once a valid source is found, Aurora stops searching. This means that if you have a contactus.tpl.html template in place, the leaveamessage.tpl.html template and any email added to the Aurora Orders Emails section will be ignored by Aurora.
Form Example
<ul>
{foreach from = $contact_info item=value key=key}
{if strlen($value)}
<li>{$key}: {$value|escape:"html":"UTF-8"|nl2br}</li>
{/if}
{/foreach}
</ul>
New fields
The key focus is around adding a new field that will be entered into the email sent out.
The hidden field allows you to enter additional information which feeds back to the contact form such as; the errors that have occurred, whether it is required, and for more complex inputs, we can use regular expressions as well. The hidden field must contain the exact same name as the input field above, with _info appended at the end.
<form method="post" action="" class="">
<label for="contact_company">Company Name *</label>
<input type="text" name="contact_company" id="contact_company" value="{$contactform.contact_company}" class="textfield" />
<input type="hidden" name="contact_company_info" value="required: true, value: Company, error: Please enter your company name" />
{'contact_company'|displayErrors}
<input type="hidden" name="contact_subject" value="123123" />
<input type="hidden" name="contact_message" value="123123" />
<input type="hidden" name="contact_name" value="123123" />
<input type="hidden" name="contact_phonenumber" value="123123" />
<input type="hidden" name="contact_email" value="[email protected]" />
<input class=" template_button" type="submit" name="contactform_submit" value="Test Now" />
</form>
Then we decide what rules should apply to this new field, for validation reasons:
<input type="text" name="contact_company" id="contact_company" value="{$contactform.contact_company}" class="textfield" />
You can see we are stating that the field is required, what the name of the field is and what error should be returned. The final piece is ensuring an error appears if required:
{'contact_company'|displayErrors}
This should contain the input name.
The data is not stored within Aurora at this time, it is only accessible via the emails/standard.tpl.html template
Site Text
The following contact form error messages are governed by the Aurora Site Text system and can be amended accordingly, please see Site Text Overview:
Site Text Page | Site Text Name | Default |
---|---|---|
Contact | Error: Name | You have not entered your name |
Contact | Error: First Name | You have not entered your first name |
Contact | Error: Last Name | You have not entered your last name |
Contact | Error: Email Address | Your email address is invalid |
Contact | Error: Order ID | Please enter your order # |
Contact | Error: Order ID Does Not Exist | Your order # does not exist |
Contact | Error: Phone Number | Your phone number does not consist of only digits, hyphens or spaces |
Contact | Error: Message | Please enter a message |
Contact | Error: Subject | Please enter a subject |
Contact | Error: Spam Content | Your message has been flagged by our servers as containing some undesirable content, please check any URLs or email addresses you have used and remove them if unsure |
Contact | Error: Spam List | You are currently in our spam list and not authorised to perform this action |
Updated over 2 years ago