How to add a feedback form to your website

Feedback form example

How to add this form to your website

  1. Open Site app and navigate to “Blocks” section.
  2. Select site.send_email_form block.
  3. Click on the code portion displayed under “Embed block in a page or template”.
  4. Copy the selected code portion and add it to the HTML code of any web page or design template.

How to change recipient email address for feedback form notifications

Messages that your clients submit via a feedback form are sent as email messages to the address specified in Site app’s settings “Email address for notifications” field in “System settings” section.

Change that value to whatever email address you want all system-wide notifications to be sent, including those submitted via a feedback form.

If you do not want to change that setting’s value, then you may specify a recipient’s email address directly in the source code of site.send_email_form block. To do so, add the desired email address between quotes in the code portion shown below; e.g.:

$wa->sendEmail("admin@mycompany.com", $errors)

You can also specify multiple recipients:

Simple format (only addresses)

{$wa->sendEmail(['address1@mycompany.com', 'address2@domain.com'], $errors)}

Extended format (email addresses + recipient names)

{$wa->sendEmail(['address1@domain.com' => 'Name1', 'address2@domain.com' => 'Name2'], $errors)}

How to remove CAPTCHA field

To protect you from automatically submitted messages (spam), the feedback form contains a CAPTCHA field.

If you believe that CAPTCHA irritates your clients who want to send feedback messages as fast as possible, you may disable the CAPTCHA field. Find the line containing a call of {$wa->sendEmail(...)} method and add the following code before it:

{$wa->storage(['captcha', $wa->app()], '')}

This a way to "tell" Webasyst that an empty CAPTCHA is the correct one, i.e. a feedback message will be successfully sent if no CAPTCHA code has been specified.

Now you will want to remove the field so that it does not mislead your website visitors. Simply find and delete the following code from the site.send_email_form block:

<div class="wa-field">
    <div class="wa-value">
        {$wa->captcha(!empty($errors.captcha))}
        {if !empty($errors.captcha)}<em class="wa-error-msg">{$errors.captcha}</em>{/if}
    </div>
</div>


0 comments

    Add comment

    To add a comment please sign up or login