hybridinteractive / craft-contact-form-extensions
Adds extensions to the Craft CMS contact form plugin.
Package info
github.com/hybridinteractive/craft-contact-form-extensions
Type:craft-plugin
pkg:composer/hybridinteractive/craft-contact-form-extensions
Requires
- php: ^8.2.0
- craftcms/cms: ^5.0.0
- craftcms/contact-form: ^3.0.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- v5.x-dev
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.0
- v4.x-dev
- 4.2.4
- 4.2.2
- 4.2.1
- 4.2.0
- 4.0.0-beta.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-develop-v5
- dev-master
- dev-develop-v4
- dev-feature/5.1.0-revive
- dev-develop
This package is auto-updated.
Last update: 2026-11-13 23:01:12 UTC
README
Adds extensions to the Craft CMS Contact Form plugin.
- Save submissions to the database and view them in the Control Panel
- Filter submissions by spam status
- Send a confirmation email to the submitting address
- Overwrite the default notification email template
- Export submissions as a flat CSV
- Add invisible reCAPTCHA (v2 or v3)
- Clear submissions by form from a Tools page
Support Open Source
This plugin is licensed under the MIT license.
Requirements
This plugin requires Craft CMS 5 and the Contact Form plugin (craftcms/contact-form ^3.0).
Installation
Install this plugin through the Plugin Store or follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project -
Then tell Composer to load the plugin:
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.
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:
- fromName
- fromEmail
- subject
- message
- attachment
submission.message still contains the hidden override and per-form fields described below (toEmail, confirmationTemplate, confirmationSubject, notificationTemplate, disableRecaptcha, disableConfirmation, disableSaveSubmission), so the overrides keep working. If your template loops over submission.message, skip those keys so their values don't end up in the email:
{% set hiddenKeys = ['toEmail', 'confirmationTemplate', 'confirmationSubject', 'notificationTemplate', 'disableRecaptcha', 'disableConfirmation', 'disableSaveSubmission'] %}
{% for key, value in submission.message|filter((v, k) => k not in hiddenKeys) %}
<p><strong>{{ key }}:</strong> {{ value is iterable ? value|join(', ') : value }}</p>
{% endfor %}
When you don't overwrite the notification template, the plugin removes these fields from Contact Form's default email body. If another plugin or module replaces or edits the HTML body of that email, the HTML is left as it is, and that code should skip these keys too.
Overriding the form name
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.
<input type="hidden" name="message[formName]" value="myFormName">
Overriding the confirmation template
When the confirmation option is enabled and custom templates per form are needed, override the template with a hashed hidden field. The template needs to be placed under templates/_emails. The same data is passed as in the default overridden template.
<input type="hidden" name="message[confirmationTemplate]" value="{{ 'contact'|hash }}">
Overriding the confirmation subject
When the confirmation option is enabled and custom subjects per form are needed, override the subject with a hashed hidden field.
<input type="hidden" name="message[confirmationSubject]" value="{{ 'confirmationSubject'|hash }}">
Overriding the notification template
When template overwrite is enabled and custom notification templates per form are needed, override the template with a hashed hidden field. The template needs to be placed under templates/_emails.
<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 }}">
Disable recaptcha on a per form basis
<input type="hidden" name="message[disableRecaptcha]" value="true">
Disable saving to database on a per form basis
<input type="hidden" name="message[disableSaveSubmission]" value="true">
Disable confirmation email on a per form basis
<input type="hidden" name="message[disableConfirmation]" value="true">
Adding invisible reCAPTCHA
Before you set your config, choose invisible reCAPTCHA while applying for keys (for v2).
Enable reCAPTCHA in the Contact Form Extensions settings and fill in your siteKey and secretKey.
Then use the following code in your forms inside of the <form> element:
{{ 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
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):
{{ craft.contactFormExtensions.recaptcha('homepage') | raw }}
Display form submissions in your template files
{% 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

