Deprecated
After much discussion, we have decided to deprecate this plugin. Originally developed by Rias, CFE came around at a time where there weren't that many Form options available., (*1)
Our recommendation would be to use either Formie or Freeform. Freeform has a free tier that should get most users the functionality required., (*2)
We would like to thank all of those that have helped carry the CFE torch as far as we have., (*3)
#
, (*4)
, (*5)
Adds extensions to the Craft CMS contact form plugin., (*6)
- Save submissions to the database and view them in the Control Panel
- Add a confirmation email that is sent to the submitting email
- Overwrite the default e-mail template
- Add an invisible reCAPTCHA
, (*7)
Support Open Source
This plugin is licensed under a MIT license, which means that it's completely free open source software, and you can use it for whatever and however you wish., (*8)
Requirements
This plugin requires Craft CMS 4 and the Contact Form plugin., (*9)
Installation
Install this plugin through the Plugin Store or follow these instructions., (*10)
-
Open your terminal and go to your Craft project:, (*11)
cd /path/to/project
-
Then tell Composer to load the plugin:, (*12)
composer require hybridinteractive/craft-contact-form-extensions
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Craft Contact Form Extensions., (*13)
Overwriting the email templates
When you overwrite the email templates, your twig view will receive a submission
variable which contains all the information that a default Contact Form submission contains:, (*14)
- fromName
- fromEmail
- subject
- message
- attachment
When saving submissions to the database the default form name will be "Contact". If you add a message[formName]
hidden field you can override the form name. This can also used to create multiple form indexes in the Control Panel., (*15)
<input type="hidden" name="message[formName]" value="myFormName">
Overriding the confirmation template
When sending confirmation option is enabled and custom templates per form are needed, override the template with a hidden field. The template needs to be placed under templates\_emails folder. Add a hash for safety. The same data is passed as in the default overridden template., (*16)
<input type="hidden" name="message[confirmationTemplate]" value="{{ 'contact'|hash }}">
Overriding the confirmation subject
When sending confirmation option is enabled and custom subjects per form are needed, override the subject with a hidden field. Add a hash for safety., (*17)
<input type="hidden" name="message[confirmationSubject]" value="{{ 'confirmationSubject'|hash }}">
Overriding the notification template
When sending notification option is enabled and custom templates per form are needed, override the template with a hidden field. The template needs to be placed under templates\_emails folder. Add a hash for safety. The same data is passed as in the default overridden template., (*18)
<input type="hidden" name="message[notificationTemplate]" value="{{ 'contact'|hash }}">
Overriding where the message is sent
<input type="hidden" name="message[toEmail]" value="{{ 'hello@rias.be'|hash }}">
Please note: Craft 5's version of this plugin does not support Recaptcha, we apologize for any inconvenience.
<input type="hidden" name="message[disableRecaptcha]" value="true">
<input type="hidden" name="message[disableSaveSubmission]" value="true">
<input type="hidden" name="message[disableConfirmation]" value="true">
Adding invisible reCAPTCHA
Before you set your config, remember to choose invisible reCAPTCHA
while applying for keys., (*19)
, (*20)
Enable reCAPTCHA in the Contact Form Extensions settings and fill in your siteKey
and secretKey
., (*21)
Then use the following code in your forms inside of the <form>
element:, (*22)
{{ craft.contactFormExtensions.recaptcha | raw }}
ReCaptcha V3
To use ReCaptcha V3, choose the V3 option in the settings, make sure to enter a correct siteKey
and secretKey
and enter a threshold
. Learn more about ReCaptcha V3, (*23)
Then include the following code in your forms inside of the <form>
element, for example for the homepage
action (actions help separate out reCaptcha submissions within the reCaptcha console):, (*24)
{{ craft.contactFormExtensions.recaptcha('homepage') | raw }}
{% for submission in craft.contactFormExtensions.submissions %}
{{ submission.dateCreated|date('d-m-Y H:i') }} - {{ submission.fromEmail }} - {{ submission.fromName }}
{% endfor %}
Brought to you by Hybrid Interactive, (*25)