Skip to content

Simple MailChimp integration with Sylius eCommerce framework.

Notifications You must be signed in to change notification settings

Vowow/SyliusMailChimpPlugin

 
 

Repository files navigation

BitBag

Overview

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.

Support

Do you want us to customize this plugin for your specific needs? Write us an email on [email protected] 💻

Installation

$ composer require bitbag/mailchimp-plugin

Import routing in your routing.yml file:

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

Add plugin dependencies to your AppKernel.php

public function registerBundles()
{
    return array_merge(parent::registerBundles(), [
        ...
        
        new \BitBag\SyliusMailChimpPlugin\BitBagSyliusMailChimpPlugin(),
    ]);
}

Usage

Add MailChimp API key and default list ID to your parameters.yml file

parameters:
    ...
    
    mailchimp.api_key: YOUR_API_KEY
    mailchimp.list_id: DEFAULT_LIST_ID

In your twig template include

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

In case you'd like to submit the form with AJAX

  1. Install assets
$ bin/console assets:install --symlink
  1. Override default sylius javascript template
<script src="{{ asset(path) }}"></script>
<script src="{{ asset('bundles/mailchimpplugin/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.

Testing

In order to run tests, execute following commands:

$ composer install
$ cd tests/Application
$ yarn install
$ yarn run gulp
$ bin/console doctrine:database:create --env test
$ bin/console doctrine:schema:create --env test
$ vendor/bin/behat
$ vendor/bin/phpunit
$ vendor/bin/phpspec

Contribution

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

About

Simple MailChimp integration with Sylius eCommerce framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 76.4%
  • Gherkin 12.3%
  • HTML 6.5%
  • JavaScript 4.8%