3brs / sylius-contact-form-plugin
Contact form plugin for Sylius.
Package info
github.com/3BRS/sylius-contact-form-plugin
Type:sylius-plugin
pkg:composer/3brs/sylius-contact-form-plugin
Requires
- php: ^8.2
- google/recaptcha: ^1.2
- sylius/sylius: ^2.1
Requires (Dev)
- behat/behat: ^3.34 || ^4.0
- behat/mink: ^1.11
- dbrekelmans/bdi: ^1.4
- dmore/chrome-mink-driver: ^2.9.3
- friends-of-behat/mink-browserkit-driver: ^v1.6.2
- friends-of-behat/mink-debug-extension: ^v2.1.0
- friends-of-behat/mink-extension: ^2.7.5 || ^3.0@alpha
- friends-of-behat/page-object-extension: ^v0.3.2
- friends-of-behat/suite-settings-extension: ^v1.1.0
- friends-of-behat/symfony-extension: ^2.6.2
- friends-of-behat/variadic-extension: ^v1.6.0
- nyholm/psr7: ^1.8
- php-http/message-factory: ^1.1.0
- phpstan/phpstan: ^2.1.10
- phpstan/phpstan-doctrine: ^2.0.12
- phpstan/phpstan-strict-rules: ^2.0.4
- phpstan/phpstan-symfony: ^2.0.3
- phpstan/phpstan-webmozart-assert: ^2.0.0
- phpunit/phpunit: ^11.5 || ^12.0.10
- rector/rector: ^2.0.10
- sylius-labs/behat-chrome-extension: ^1.5
- sylius-labs/coding-standard: ^v4.4.0
- sylius/sylius-rector: ^v3.0.0
- symfony/browser-kit: ^7.4 || ^8.0
- symfony/config: ^7.4 || ^8.0
- symfony/debug-bundle: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/doctrine-bridge: ^7.4 || ^8.0
- symfony/doctrine-messenger: ^7.4 || ^8.0
- symfony/dotenv: ^7.4 || ^8.0
- symfony/filesystem: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/intl: ^7.4 || ^8.0
- symfony/maker-bundle: ^1.60
- symfony/messenger: ^7.4 || ^8.0
- symfony/property-info: ^7.4 || ^8.0
- symfony/var-dumper: ^7.4 || ^8.0
- symfony/var-exporter: ^7.4 || ^8.0
- symfony/web-profiler-bundle: ^7.4 || ^8.0
- symplify/easy-coding-standard: ^12.0
Suggests
None
Provides
None
Conflicts
- api-platform/core: <4.2.0
- api-platform/json-schema: <4.2.0
- api-platform/metadata: <4.2.0
- api-platform/symfony: <4.2.0
- babdev/pagerfanta-bundle: <3.6.1
- doctrine/collections: <1.7.0
- doctrine/data-fixtures: <1.5.1
- doctrine/dbal: <2.13.3
- doctrine/doctrine-bundle: <2.8.0
- friendsofsymfony/rest-bundle: <3.1.0
- jms/serializer-bundle: <4.2.0
- knplabs/knp-menu: <3.3.0
- knplabs/knp-menu-bundle: <3.5.0
- lexik/jwt-authentication-bundle: <2.12
- liip/imagine-bundle: 2.17.0
- masterminds/html5: <2.7.5
- payum/core: <1.7.3
- sylius/resource-bundle: <1.13.0
- sylius/sylius: <2.1.0
- sylius/twig-extra: >=0.9.0 <0.9.1
- sylius/twig-hooks: >=0.9.0 <0.9.1
- symfony/framework-bundle: >=5.4.0 <=5.4.20|>=6.0.0 <=6.0.16|>=6.1.0 <=6.1.8|>=6.2.0 <=6.2.2|6.2.8
- symplify/easy-coding-standard: <10.2.0
- twig/twig: <2.14.7
- webmozart/assert: <1.11.0
- willdurand/negotiation: <3.0
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 11:53:26 UTC
README
Contact Form Plugin
Features
- Extend contact form
- Add a ReCaptcha Verification to the contact form (only supports invisible ReCaptcha V2)
- Add Message administrative panel
- conversation history
- Possibility to respond instantly
Requirements
| Package | Version |
|---|---|
| PHP | ^8.2 |
| Sylius | ^2.1 |
| Symfony | ^7.4 || ^8.0 |
Installation
-
Run
composer require 3brs/sylius-contact-form-plugin. -
Register
\ThreeBRS\SyliusContactFormPlugin\ThreeBRSSyliusContactFormPluginin your Kernel.// config/bundles.php ThreeBRS\SyliusContactFormPlugin\ThreeBRSSyliusContactFormPlugin::class => ['all' => true],
-
Add resource to
config/packages/_sylius.yamlimports: # ... - { resource: "@ThreeBRSSyliusContactFormPlugin/config/config.yml" }
-
Add routing to
config/routes.yamlthreebrs_sylius_contact_form_plugin: resource: "@ThreeBRSSyliusContactFormPlugin/config/routing.yml"
-
Define parameters in
.envfile (or whenever you keep your environment variables):# Recaptcha public key setter for contact form GOOGLE_RECAPTCHA_SITE_KEY= # Recaptcha secret key setter for contact form GOOGLE_RECAPTCHA_SECRET= -
Create and run doctrine database migrations.
For the guide how to use your own entity see Sylius docs - Customizing Models
Usage
- Parameters can be left empty if you want to run the plugin without recaptcha verification. Recaptcha is enabled only when both keys are set, otherwise the Google script is not loaded.
- The plugin is made to work with invisible V2 recaptcha, it is essential to select this version during their creation.
- The plugin defines the contact email of the channel (configurable in the
Channelstab of theconfigurationsection in the administration panel) as the manager's email address.
Configuration
threebrs_sylius_contact_form_plugin: # Define if an email should be sent to the manager when contact form is send send_manager_mail: true/false # Define if an email should be sent to the customer when contact form is send (copy) send_customer_mail: true/false # Define 'name' field requirement in contact form name_required: true/false # Define 'phone' field requirement in contact form phone_required: true/false
Usage
- Log into admin panel as administrator or account panel as registered customer
- Go into
Messagessection - Select the conversation you want to answer to
- Write your reply message
- Click
Sendbutton below
Development
Setup
Initialize the development environment:
make init
This command installs dependencies, sets up the database, and prepares frontend assets (or follow related steps in Makefile).
Usage
- Develop your plugin logic inside
/src - See
bin/for useful dev tools
Testing
After your changes you must ensure that the tests are still passing.
make tests # Or run individual commands: make static # phpstan, ecs, lint make behat # behat tests
License
This library is under the MIT license.