- Per channel configurable options
- Subscribe user during checkout
- Subscribe user during registration
- Sync newsletter preferences in customer's profile
- Select the mailing list per channel
- Configure double opt-in per channel
- This plugin, unlike others, can handle large mailing lists
- Run
$ composer require 3brs/sylius-mailchimp-plugin. - Register
\ThreeBRS\SyliusMailChimpPlugin\ThreeBRSSyliusMailChimpPluginin your Kernel. - Your Entity
Channelhas to implement\ThreeBRS\SyliusMailChimpPlugin\Entity\ChannelMailChimpSettingsInterface. You can use TraitThreeBRS\SyliusMailChimpPlugin\Entity\ChannelMailChimpSettingsTrait. - Add config to
config/packages/_sylius.yamlimports: ... - { resource: "@ThreeBRSSyliusMailChimpPlugin/config/config.yaml" }
- Generate and run doctrine database migrations:
$ bin/console doctrine:migrations:diff $ bin/console doctrine:migrations:migrate
For guide to use your own entity see Sylius docs - Customizing Models.
Set the API Key in parameters.yml
three_brs_sylius_mail_chimp:
mailchimp_api_key: API_KEY
The newsletter subscription checkbox is automatically injected into the checkout address page via Sylius Twig hooks.
If you want to disable this feature, add the following configuration to your config/packages/_sylius.yaml file:
sylius_twig_hooks:
hooks:
'sylius_shop.checkout.address.content.form.addresses.billing_address.address':
newsletterSubscribeForm:
enabled: false- Create symlink from .env.dist to .env or create your own .env file
- Develop your plugin in
/src - See
bin/for useful commands
After your changes you must ensure that the tests are still passing.
$ composer install
$ bin/console doctrine:schema:create -e test
$ bin/phpstan.sh
$ bin/ecs.shThis library is under the MIT license.
