Simplecontact is a Herbie plugin that allows you to add a simple contact form to your website.
Such a form consists of the fields name, email and message., (*1)
Installation
The plugin is installed via Composer., (*2)
$ composer require getherbie/plugin-simplecontact
After that, the plugin can be activated in the configuration file., (*3)
plugins:
enable:
- simplecontact
Configuration
Under plugins.simplecontact.config the following options are available., (*4)
The email address to which the form will be sent:, (*5)
recipient: (string)
Aliased template path to custom form template:, (*6)
template: (string)
Notes
If you have enabled page caching, you must disable it., (*7)
---
title: Contact form
cached: false
---
Also, the global config components.pageRendererMiddleware.cache must be set to false.
Otherwise the page would be loaded from the page cache., (*8)
The form is then rendered using the twig function of the same name., (*9)
{{ simplecontact() }}
Additional content can be placed before or after the function call.
A complete contact page looks like this:, (*10)
---
title: Contact form
cached: false
---
# Contact form
Please fill in all fields of the contact form:
{{ simplecontact() }}
We can also be reached via email or phone at...
Demo
A live demo can be viewed at https://herbie.tebe.ch/contact., (*11)