Forms

Visitor-submitted information to the website server is done via so-called forms.

The most common example of forms is the contact form, that sends the submitted information by email. 

The controls through which site visitors enter information can be found in the "Navigation and Forms" section of the “More” popup: 

  • Text Input field
  • Button
  • Radio button
  • Checkbox

The Text Input is the basic text entry tool. Aside from styling controls it has a few options to control user input. Setting the Required checkbox forces the user to fill something in the text input. The Automatic capitalization, Spelling Checker and Allow browser auto-fill can be useful in specific contexts. 

Radio buttons and checkboxes are used to provide user options, radio buttons with the same name are mutually exclusive so they allow the user a single choice, whereas checkboxes are all independent and offer a yes/no answer.

Both Email Form via Server and Advanced Form Submission allow you to collect the input from one or more text input fields, checkboxes and radio buttons. While Advanced Form Submission is aimed at experienced web developers, the Email Form via Server is ready to use.

Both Form features are disabled in preview and won’t work when opened from the Finder, as they require a web server to process the email reception and will only work if the pages are accessed through a server.

Contact form 

The Email Form via Server option collects the selected form elements and emails them. The feature is immediately functional by filling in the to and from email addresses and the email subject. 

You will also need to designate a “Thank you” page, that will contain the machinery to send the form, and can be used to inform the user of the successful email delivery. As the page contains server side code it will need to have a php extension (the thank you page section will let you do that).

Email is delivered locally on your web host, and routed to the destination mail server from there. Email on the internet is frequently aggressively filtered for spam and viruses, and as such it might occasionally not work properly. The best way to solve issues is to contact the web host.

Custom SMTP server 

If your web host doesn’t allow sending email via the web server, you can opt to send email via authenticated SMTP. This means the mail handling generated by Sparkle will contact the SMTP server and authenticate itself using the login settings you specify. This is compatible with third party services such as Amazon SES.

Contact form sample 

For your convenience you can download a sample document with a functional contact form in it, you’ll need to change the destination email address to your own.

contact form.sparkle

Please report any shortcoming in this documentation and we’ll fix it as soon as possible!

Troubleshooting contact forms 

If you aren’t receiving the contact form email, here are a few common problems:

  • you might have incorrectly entered the destination email address; this manifests itself as the thank you page loading correctly with no further indication that something went wrong;
  • you might have forgotten to set the thank you page to PHP; this manifests itself as the thank you page loading correctly, but if you notice the page address in Safari might have a .html extension instead of a .php extension;
  • the server might not allow PHP execution; this manifests itself as the page source loading, instead of the properly formatted “thank you” page; you need to contact your web host about adding PHP support to your hosting plan;
  • your domain’s email setup doesn’t allow email to be sent from your web server; this needs to be solved by your web host.

If none of the above lead to a solution the final possibility is that the contact form email is being properly sent, but it’s then being caught by spam filters.

A helpful measure to prevent your email from being discarded is to use a From email address on your server’s domain, it doesn’t have to be a functional mailbox, so for example if your domain is example.com you might use nobody@example.com.

Sometimes using a custom SMTP server can improve the quality of outgoing email.

You can use a third party service to check how to the email fares in the eyes of spam filters, and work from there on improving the quality.

One such service is mail-tester.com. When you visit the site you get an email address you will place as destination in your form settings, then publish the site and use the contact form. Now going back to mail-tester.com will show what the spam filters see and possibly suggest corrective measures.

This site uses cookies. Some are essential to make our site work; others help us improve the user experience. By using the site, you consent to the placement of these cookies. Read our privacy policy to learn more.

X