Skip to content

Commit

Permalink
Merge pull request #148 from hybridinteractive/develop-v4
Browse files Browse the repository at this point in the history
Develop v4
  • Loading branch information
DynamiteGoesBoom authored May 16, 2022
2 parents 9ac71e2 + c9f8e98 commit 08f0be5
Show file tree
Hide file tree
Showing 23 changed files with 1,995 additions and 1,465 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [4.0.0-beta.3] - 2022-05-16
There were many updates made for this plugin and cleaned up and adjusted many things. The 4 changes below will need to be updated in the templates in order for everything to work.

```
message['template'] -> message['confirmationTemplate']
message['subject'] -> message['confirmationSubject']
message['recaptchaTemplateOverride'] -> message['disableRecaptcha']
message['saveSubmissionOverride'] -> message['disableSaveSubmission']
```

## [1.3.0] - 2022-04-14
- Adding ability to override recaptcha on a per form basis. [#108](https://github.com/hybridinteractive/craft-contact-form-extensions/issues/108)
- Override for saving to db on a per form basis
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This plugin is licensed under a MIT license, which means that it's completely fr

## Requirements

This plugin requires Craft CMS 3 and the [Contact Form](https://github.com/craftcms/contact-form) plugin.
This plugin requires Craft CMS 4 and the [Contact Form](https://github.com/craftcms/contact-form) plugin.

## Installation

Expand Down Expand Up @@ -57,14 +57,21 @@ When saving submissions to the database the default form name will be "Contact".
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.

```
<input type="hidden" name="message[template]" value="{{ 'contact'|hash }}">
<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.

```
<input type="hidden" name="message[subject]" value="{{ 'subject'|hash }}">
<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.

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

## Overriding where the message is sent
Expand All @@ -73,19 +80,19 @@ When sending confirmation option is enabled and custom subjects per form are nee
<input type="hidden" name="message[toEmail]" value="{{ '[email protected]'|hash }}">
```

## Overriding recaptcha on a per form basis
## Disable recaptcha on a per form basis

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

## Overriding saving to database on a per form basis
## Disable saving to database on a per form basis

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

## Overriding confirmation email on a per form basis
## Disable confirmation email on a per form basis

```
<input type="hidden" name="message[disableConfirmation]" value="true">
Expand Down
111 changes: 61 additions & 50 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,66 @@
{
"name": "hybridinteractive/craft-contact-form-extensions",
"description": "Adds extensions to the Craft CMS contact form plugin.",
"type": "craft-plugin",
"version": "1.3.0",
"keywords": [
"craft",
"cms",
"craftcms",
"craft-plugin",
"craft contact form extensions"
],
"support": {
"docs": "https://github.com/hybridinteractive/craft-contact-form-extensions/blob/master/README.md",
"issues": "https://github.com/hybridinteractive/craft-contact-form-extensions/issues"
},
"license": "MIT",
"authors": [
{
"name": "Hybrid Interactive",
"homepage": "https://hybridinteractive.io"
}
],
"require": {
"craftcms/cms": "^3.1",
"craftcms/contact-form": "^2.1",
"albertcht/invisible-recaptcha": "^1.8"
},
"autoload": {
"psr-4": {
"hybridinteractive\\contactformextensions\\": "src/"
}
},
"extra": {
"name": "Contact Form Extensions",
"handle": "contact-form-extensions",
"schemaVersion": "1.0.1",
"hasCpSettings": true,
"hasCpSection": true,
"changelogUrl": "https://github.com/hybridinteractive/craft-contact-form-extensions/blob/master/CHANGELOG.md",
"components": {
"contactFormExtensionsService": "hybridinteractive\\contactformextensions\\services\\ContactFormExtensionsService"
},
"class": "hybridinteractive\\contactformextensions\\ContactFormExtensions"
"name": "hybridinteractive/craft-contact-form-extensions",
"description": "Adds extensions to the Craft CMS contact form plugin.",
"version": "4.0.0-beta.3",
"type": "craft-plugin",
"keywords": [
"cms",
"craftcms",
"craft",
"craft-plugin",
"craft contact form extensions"
],
"license": "MIT",
"authors": [
{
"name": "Hybrid Interactive",
"homepage": "https://hybridinteractive.io"
}
],
"support": {
"docs": "https://github.com/hybridinteractive/craft-contact-form-extensions/blob/master/README.md",
"issues": "https://github.com/hybridinteractive/craft-contact-form-extensions/issues"
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.0.2",
"albertcht/invisible-recaptcha": "^1.8",
"composer/composer": "^2.2.12",
"craftcms/cms": "^4.0.0",
"craftcms/contact-form": "^3.0.0"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main"
},
"autoload": {
"psr-4": {
"hybridinteractive\\contactformextensions\\": "src/"
}
},
"extra": {
"name": "Contact Form Extensions",
"handle": "contact-form-extensions",
"changelogUrl": "https://github.com/hybridinteractive/craft-contact-form-extensions/blob/master/CHANGELOG.md",
"documentationUrl": "https://github.com/hybridinteractive/craft-contact-form-extensions/blob/master/README.md",
"components": {
"contactFormExtensionsService": "hybridinteractive\\contactformextensions\\services\\ContactFormExtensionsService"
},
"require-dev": {
"roave/security-advisories": "dev-master"
"class": "hybridinteractive\\contactformextensions\\ContactFormExtensions"
},
"scripts": {
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --ansi --fix",
"phpstan": "phpstan --memory-limit=1G"
},
"config": {
"platform": {
"php": "8.0.2"
},
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
}
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
}
}
}
Loading

0 comments on commit 08f0be5

Please sign in to comment.