2017 © Pedro Peláez
 

craft-plugin craft-contact-form-extensions

Adds extensions to the Craft CMS contact form plugin.

image

rias/craft-contact-form-extensions

Adds extensions to the Craft CMS contact form plugin.

  • Tuesday, July 31, 2018
  • by Rias500
  • Repository
  • 1 Watchers
  • 21 Stars
  • 446 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 6 Open issues
  • 10 Versions
  • 288 % Grown

The README.md

Craft Contact Form Extensions

Icon, (*1)

Latest Version Total Downloads, (*2)

Adds extensions to the Craft CMS contact form plugin., (*3)

  • 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

Screenshot, (*4)

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., (*5)

Requirements

This plugin requires Craft CMS 3 and the Contact Form plugin., (*6)

Installation

Install this plugin through the Plugin Store or follow these instructions., (*7)

  1. Open your terminal and go to your Craft project:, (*8)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*9)

    composer require hybridinteractive/craft-contact-form-extensions
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Craft Contact Form Extensions., (*10)

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:, (*11)

  • 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., (*12)

<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., (*13)

<input type="hidden" name="message[template]" 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., (*14)

<input type="hidden" name="message[subject]" value="{{ 'subject'|hash }}">

Overriding where the message is sent

<input type="hidden" name="message[toEmail]" value="{{ 'hello@rias.be'|hash }}">

Overriding recaptcha on a per form basis

<input type="hidden" name="message[recaptchaTemplateOverride]" value="true">

Overriding saving to database on a per form basis

<input type="hidden" name="message[saveSubmissionOverride]" value="true">

Overriding confirmation email on a per form basis

<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., (*15)

Screenshot, (*16)

Enable reCAPTCHA in the Contact Form Extensions settings and fill in your siteKey and secretKey., (*17)

Then use the following code in your forms inside of the <form> element:, (*18)

{{ 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, (*19)

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):, (*20)

{{ 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, (*21)

The Versions

31/07 2018

dev-master

9999999-dev

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

31/07 2018

1.0.8

1.0.8.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

13/07 2018

1.0.7

1.0.7.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

07/06 2018

1.0.6

1.0.6.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

01/06 2018

1.0.5

1.0.5.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

22/05 2018

1.0.4

1.0.4.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

14/05 2018

1.0.3

1.0.3.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

10/05 2018

1.0.2

1.0.2.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

08/05 2018

1.0.1

1.0.1.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions

06/05 2018

1.0.0

1.0.0.0

Adds extensions to the Craft CMS contact form plugin.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft contact form extensions