With webRES Custom Pages you can make a form that will send an email, like a contact form or enquiry form.

  1. Add Custom Page
    1. Go to Applications > webXG webRES > Custom Page Configuration to create your new form page.
    2. Click on New Page
    3. Enter a filename for your new page with the format email_forms/FORMNAME/form.html where FORMNAME is the unique name of your form e.g.
      email_forms/my_form/form.html
      

      NOTE: make sure your form name doesn't contain any spaces or special characters.

    4. Enter an alias for this page FORMNAME.html e.g.
      my_form.html
      
    5. Click Save Page

    Some other example names:

    test_form

    • Page Name: email_forms/test_form/form.html
    • Alias: test_form.html
    • URL: www.example.com/test_form.html

    vehicle/enquiry

    • Page Name: email_forms/vehicle/enquiry/form.html
    • Alias:vehicle/enquiry.html
    • URL: www.example.com/vehicle/enquiry.html
  2. Add the html form contents
    1. Click on the page name you just created
    2. Click on Edit Source
    3. Add the code for your form. Do not put the
      elements as these will be added automatically. Example:
    4. <&| /mc/box  &>
         

      Forms are fun!


  3. Add Email template
    1. Go back to Custom Page Configuration like step 1 again to add an email template. Use the format email_forms/FORMNAME/email.html e.g.
      email_forms/my_form/email.html
      
    2. In the email template you can print variables from the form using the code
      <% $input->{FIELDNAME} %>
      

      These variables will be named by the name="" attribute on the form fields. Example:

      <% $input->{name} %> has filled out your form.
      <% $input->{forms_are_fun} %>
      
      <%args>
        $input => {}
      
      <%flags>
        inherit => undef
      
      <%attr>
        to => 'contact@example.com'
        from => 'webmaster@example.com'
        cc => 'sales@example.com'
        bcc => 'webmaster@example.com'
        subject => 'Email from form'
      
      
      
    3. Customise the fields in the attr section with the subject and email addresses to send to.
  4. Add confirmation page
    1. The final step is to add a page that will be shown to the user after they submit the form. Use the name format
      email_forms/FORMNAME/onsubmit.html 
      

      e.g.:

      email_forms/my_form/onsubmit.html
      
    2. Click Edit Source as before and enter the code for the confirmation page e.g.
      <&| /mc/box  &>
        Thanks <% $input->{name} %>! An email will be sent. 
      
      <%args>
        $input => {}
      
      

  5. Test your form Your form will be available at your website using the alias you set earlier. e.g.
    www.example.com/my_form.html
    

Note:This facility is only available for a custom, non-tabbed page.