bitbag/mailchimp-plugin

MailChimp plugin for Sylius.

Installs: 17 433

Dependents: 0

Suggesters: 0

Security: 0

Stars: 35

Watchers: 2

Forks: 6

Open Issues: 4

Type:sylius-plugin


README

68747470733a2f2f73796c6975732e636f6d2f6173736574732f62616467652d617070726f7665642d62792d73796c6975732e706e67

About us

At BitBag we do believe in open source. However, we are able to do it just beacuse of our awesome clients, who are kind enough to share some parts of our work with the community. Therefore, if you feel like there is a possibility for us working together, feel free to reach us out. You will find out more about our professional services, technologies and contact details at https://bitbag.io/.

BitBag SyliusMailChimpPlugin

This plugin allows you to integrate MailChimp newsletter sign-in process with Sylius platform through customer registration, account updates or footer/modal join newsletter form.

Demo

We created a demo app with some useful use-cases of the plugin! Visit demo.bitbag.shop to take a look at it. The admin can be accessed under demo.bitbag.shop/admin link and sylius: sylius credentials.

Installation

$ composer require bitbag/mailchimp-plugin

Add plugin dependencies to your config/bundles.php file:

return [
    ...

    BitBag\SyliusMailChimpPlugin\BitBagSyliusMailChimpPlugin::class => ['all' => true],
];

Import routing on top of your config/routes.yaml file:

# config/routes.yaml

bitbag_sylius_mailchimp_plugin:
    resource: "@BitBagSyliusMailChimpPlugin/Resources/config/routing.yml"

Configure MailChimp credentials

# .env

...
MAIL_CHIMP_API_KEY=YOUR_KEY

MAIL_CHIMP_LIST_ID=YOUR_LIST_ID

Include the newsletter in your template:

{% include '@BitBagSyliusMailChimpPlugin/_subscribe.html.twig' %}

Install the assets

$ bin/console assets:install --symlink

Add these javascripts to the layout template that includes your subscription form imported in the previous steps

<script src="{{ asset(path) }}"></script>
<script src="{{ asset('bundles/bitbagsyliusmailchimpplugin/bitbag-mailchimp-plugin-newsletter.js') }}"></script>
<script>
    $('#footer-newsletter-form').joinNewsletter();
</script>

That's the simplest and fastest way to integrate the jQuery plugin. If you need to customize it, simply take a look at bitbag-mailchimp-plugin-newsletter.js, create your own *.js plugin and import it in your main Gulpfile.js.

Customization

Available services you can decorate and forms you can extend

$ bin/console debug:container | grep bitbag_sylius_mailchimp_plugin

Parameters you can override in your parameters.yml(.dist) file

$ bin/console debug:container --parameters | grep bitbag

Testing

$ composer install
$ cd tests/Application
$ yarn install
$ yarn run gulp
$ bin/console assets:install public -e test
$ bin/console doctrine:schema:create -e test
$ bin/console server:run 127.0.0.1:8080 -d public -e test
$ mailChimp
$ open http://localhost:8080
$ vendor/bin/behat
$ vendor/bin/phpspec run

Contribution

Learn more about our contribution workflow on http://docs.sylius.org/en/latest/contributing/.