In this series of articles, I am going to introduce each of the plugins I have developed for ClassicPress, a hard-fork of WordPress, which was originally created to provide an alternative, yet compatible, CMS without the Gutenberg block editor.
The 10th plugin is Contact Forms.
A simple contact forms plugin with an options page allowing default settings to be configured; these settings can, in most cases, be overridden when adding a contact form to a page. This plugin supports the use of multiple contact forms on a page.
Contact forms can be placed on pages using the simple-contact-form
shortcode which supports the following parameters:
id
is the only mandatory parameter; a unique id for each contact form on the page must be supplied.send-from-email
allows the default send from email address to be overridden.send-from-name
allows the default send from email name to be overridden.recipients
is a comma separated list of email address which allows the default recipients to be overridden.label-name
allows the default label for the name field to be overridden.label-email
allows the default label for the email field to be overridden.label-subject
allows the default label for the subject field to be overridden.label-message
allows the default label for the message field to be overridden.subject
allows the default subject for the name field to be overridden. If an empty subject is provided, users can free form type a subject. Multiple subjects to allow picking from a drop down list can be supplied, separated with a|
.subject-prefix
allows a subject prefix to be added to all subjects when the email is sent and override the default.
Example shortcode usage:
[simple-contact-form id=”contact-us” recipients=”bob@example.com,jane@example.com” subject=”Sales|Support|Accounts” subject-prefix=”Contact us from example.com:”]
This plugin is multisite compatible, with options set on a per site basis.