Adds extensions to the Craft CMS contact form plugin.
Clone or download
Latest commit f5996f0 Sep 26, 2018
Permalink
Failed to load latest commit information.
resources Add recaptcha Jun 1, 2018
src Fixed sender to be correct. The sender should not be the one in the s… Sep 21, 2018
.gitignore Init May 6, 2018
CHANGELOG.md 1.0.11 Sep 26, 2018
LICENSE.md Init May 6, 2018
README.md Add reCAPTCHA to readme Jun 1, 2018
composer.json 1.0.11 Sep 26, 2018

README.md

Icon

Latest Version Quality Score StyleCI Total Downloads

Craft Contact Form Extensions

Adds extensions to the Craft CMS contact form plugin.

  • 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 invisble reCAPTCHA

Screenshot

Support Open Source. Buy beer.

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. If you're using it and want to support the development, buy me a beer over at Beerpay!

Beerpay

Requirements

This plugin requires Craft CMS 3 and the Contact Form plugin.

Installation

Install this plugin through the Plugin Store or follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require rias/craft-contact-form-extensions
    
  3. 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

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">

Adding invisible reCAPTCHA

Before you set your config, remember to choose invisible reCAPTCHA while applying for keys.

Screenshot

Enable reCAPTCHA in the Contact Form Extensions settings and fill in your siteKey and secretKey.

Then use the following code in your forms:

{{ craft.contactFormExtensions.recaptcha | raw }}

Brought to you by Rias