3brs/sylius-mailchimp-plugin

MailChimp plugin for Sylius

Installs: 241

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:sylius-plugin

pkg:composer/3brs/sylius-mailchimp-plugin

v2.0.1 2025-11-10 07:43 UTC

README

MailChimp Plugin

Features

  • 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

Installation

  1. Run $ composer require 3brs/sylius-mailchimp-plugin.
  2. Register \ThreeBRS\SyliusMailChimpPlugin\ThreeBRSSyliusMailChimpPlugin in your Kernel.
  3. Your Entity Channel has to implement \ThreeBRS\SyliusMailChimpPlugin\Entity\ChannelMailChimpSettingsInterface. You can use Trait ThreeBRS\SyliusMailChimpPlugin\Entity\ChannelMailChimpSettingsTrait.
  4. Add config to config/packages/_sylius.yaml
    imports:
         ...
             - { resource: "@ThreeBRSSyliusMailChimpPlugin/config/config.yaml" }
  5. 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.

Configuration

Set the API Key in parameters.yml

three_brs_sylius_mail_chimp:
    mailchimp_api_key: API_KEY

Subscription from checkout

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

Development

Usage

  • Create symlink from .env.dist to .env or create your own .env file
  • Develop your plugin in /src
  • See bin/ for useful commands

Testing

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.sh

License

This library is under the MIT license.

Credits

Developed by 3BRS
Forked from manGoweb.