bolt/forms-extra-recipients

是bolt/forms的扩展,允许您根据条件向表单添加额外收件人。

安装: 241

依赖关系: 0

建议者: 0

安全: 0

星标: 2

关注者: 4

分支: 0

开放问题: 0

类型:bolt-extension

1.0.0 2020-10-27 10:58 UTC

This package is auto-updated.

Last update: 2024-08-27 19:47:28 UTC


README

是bolt/forms的扩展,允许您向表单添加额外收件人。

安装

composer require bolt/forms-extra-recipients

设置

假设您的contact表单有一个department字段,如下所示:

        department:
            type: choice
            options:
                required: true
                choices: { 'sales' : 'sales', 'accounts': 'accounts' }

根据用户的选择,不同的人将收到这个表单。

要实现这一点,请转到config/extensions/bolt-boltformsextrarecipients.yaml并在配置中添加以下内容:

参考扩展配置文件

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 ]

根据department字段的值,表单将发送到销售或账户相关人员。

运行PHPStan和Easy Codings Standard

首先,确保已安装依赖项

COMPOSER_MEMORY_LIMIT=-1 composer update

然后运行ECS

vendor/bin/ecs check src