bolt / forms-extra-recipients
An extension of bolt/forms that allows you to add extra recipients to forms, with conditions.
Installs: 247
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Type:bolt-extension
Requires
- php: >=7.1.3
- bolt/forms: ^1.0
- twig/twig: ^2.12 | ^3.0
Requires (Dev)
- bolt/core: ^4.0.0
- symplify/easy-coding-standard: ^6.0
README
An extension of bolt/forms that allows you to add extra recipients to forms.
Installation:
composer require bolt/forms-extra-recipients
Setting up
Suppose your contact
form has a department
field like so:
department: type: choice options: required: true choices: { 'sales' : 'sales', 'accounts': 'accounts' }
Depending on what the user selects, different people will receive this form.
To do this, go to config/extensions/bolt-boltformsextrarecipients.yaml
and put the following in your configuration:
Reference extension configuration file
actions: send_contact_submissions: form: contact to: field: name: department values: sales: [ dan@arb.com, casey@arb.com, bob@twokings.nl, sammar@twokings.nl ] accounts: [ james@arb.com, anne@arb.com ]
Based on the value of the department
field, the form will go either to the people from Sales, or Accounts.
Running PHPStan and Easy Codings Standard
First, make sure dependencies are installed:
COMPOSER_MEMORY_LIMIT=-1 composer update
And then run ECS:
vendor/bin/ecs check src