WGG/PIMCORE-MAILCHIMP

Installation

$ composer require wgg/pimcore-mailchimp

Via Extension Manager

After you have installed the Mailchimp Bundle via composer, open Pimcore backend and go to Tools => Bundles:

Via CommandLine

After you have installed the Mailchimp Bundle via composer:

Upgrading

Upgrading via Extension Manager

After you have updated the Mailchimp Bundle via composer, open Pimcore backend and go to Tools => Bundles:

Upgrading via CommandLine

After you have updated the Mailchimp Bundle via composer:

Migrate via CommandLine

Does actually the same as the update command and preferred in CI-Workflow:

Bundle configuration

The bundle currently supports two kind of configuration storage:

You can configure it:

# Use the FileStorage
wgg_mailchimp:
  storage: 'Wgg\MailchimpBundle\Storage\FileStorage' #this is the default
# Use the SettingsStore
wgg_mailchimp:
  storage: 'Wgg\MailchimpBundle\Storage\SettingsStoreStorage'

You can also implement your own storage.

<?php

namespace Acme;

class OwnStorage implements \Wgg\MailchimpBundle\Storage\StorageInterface
{
    public function read(): array
    {
        // You own logic to get the data
        return [];
    }
    
    public function write(string $apiKey, string $serverPrefix, array $listIds): void
    {
        // You own logic to save the data
    }
}
# Use your own storage implementation
# 1. register your class
services:
  Acme\OwnStorage: ~

# 2. Configure the bundle to use your storage
wgg_mailchimp:
  storage: 'Acme\OwnStorage'

Usage

Configuration is accessible from the Settings / Mailchimp Settings on the administration panel.

Through Wgg\MailchimpBundle\ApiClient service you can access all Mailchimp API functionality.

You can use Wgg\MailchimpBundle\ListOptionsProvider service in a Select Type for audience/list ids.

From twig you can use mailchimp_list_store function to get access to list/audience ids and names.

Testing configuration

On the admin panel there is a Validate settings button - you can use it to validate the configuration.

From cli you can ping the Mailchimp API and get information about the configured lists:

$ bin/console wg:mailchimp:ping
$ bin/console wg:mailchimp:get-list