bolt/forms-extra-recipients

An extension of bolt/forms that allows you to add extra recipients to forms, with conditions.

Installs: 65

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:bolt-extension

1.0.0 2020-10-27 10:58 UTC

This package is auto-updated.

Last update: 2021-09-27 13:03:40 UTC


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