Visitor-submitted information to the website server is done via forms, digital counterparts to paper 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 “Add” popup:
Additionally you can add a complete login form, covered in more detail in the Password Protection page.
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.
A Drop-down Selection form element lets visitors pick an option from a closed set of pre-defined options. A File Attachment form elements lets visitors pick and submit a file from their device. When using the built-in “Email Form via Server”, the attachment will be delivered via email, attached to the contact form email.
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 form reception.
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.
The sender email address will only be seen by the recipient of the mail form, so it doesn’t need to be a functional email address. For the best deliverability (meaning not being caught by spam filters) it is advisable for it to be a fake mailbox at the same domain where the site is hosted.
The reply address setting designates an input field that the site visitor is expected to fill with their email address.
You will also need to designate a “Thank you” page, in that page Sparkle will place (invisible) machinery to actually send the form, and can be used to inform the user of the successful email delivery. Since that page contains server side code it will automatically be set to have a php extension.
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.
Sparkle contact forms include anti-spam provisions that prevent automated internet bots from submitting spam content, while also not burdening the visitor to your site with unnecessary annoyances typical of captcha-like solutions. Sparkle’s spam-prevention solution also does not leak information about your visitors to any third party, and is thus compliant with privacy regulation. We are committed to fighting spam and will make all technical modifications necessary to block future spam attacks.
Troubleshooting contact forms
If you aren’t receiving the contact form email, here are a few common problems:
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 email@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 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.
Please report any shortcoming in this documentation and we’ll fix it as soon as possible!
Updated for Sparkle 5.2