https://github.com/bolt/forms-extra-recipients
An extension of bolt/forms that allows you to add extra recipients to forms, with conditions.
https://github.com/bolt/forms-extra-recipients
Last synced: 3 months ago
JSON representation
An extension of bolt/forms that allows you to add extra recipients to forms, with conditions.
- Host: GitHub
- URL: https://github.com/bolt/forms-extra-recipients
- Owner: bolt
- License: mit
- Created: 2020-10-06T14:27:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-27T10:59:36.000Z (over 4 years ago)
- Last Synced: 2025-02-18T16:49:31.295Z (4 months ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bolt Forms Extra Recipients Extension
An extension of bolt/forms that allows you to add extra recipients to forms.
Installation:
```bash
composer require bolt/forms-extra-recipients
```## Setting up
Suppose your `contact` form has a `department` field like so:
```yaml
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: [ [email protected], [email protected], [email protected], [email protected] ]
accounts: [ [email protected], [email protected] ]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
```