Skip to content

Simple MailChimp integration with Sylius eCommerce framework.

License

Notifications You must be signed in to change notification settings

BartoszWojdalowicz/SyliusMailChimpPlugin

 
 

Repository files navigation

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

About

Simple MailChimp integration with Sylius eCommerce framework.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 75.7%
  • Gherkin 9.7%
  • JavaScript 7.2%
  • Twig 5.2%
  • Shell 2.2%