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/.
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.
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.
$ 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
.
$ bin/console debug:container | grep bitbag_sylius_mailchimp_plugin
$ bin/console debug:container --parameters | grep bitbag
$ 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
Learn more about our contribution workflow on http://docs.sylius.org/en/latest/contributing/.