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:
- Click the green
+Button inEnable / Disablerow - Click the green
+Button inInstall / Uninstallrow
Via CommandLine
After you have installed the Mailchimp Bundle via composer:
- Execute:
$ bin/console pimcore:bundle:enable WggMailchimpBundle - Execute:
$ bin/console pimcore:bundle:install WggMailchimpBundle
Upgrading
Upgrading via Extension Manager
After you have updated the Mailchimp Bundle via composer, open Pimcore backend and go to Tools => Bundles:
- Click the green
+Button inUpdaterow
Upgrading via CommandLine
After you have updated the Mailchimp Bundle via composer:
- Execute:
$ bin/console pimcore:bundle:update WggMailchimpBundle
Migrate via CommandLine
Does actually the same as the update command and preferred in CI-Workflow:
- Execute:
$ bin/console pimcore:migrations:migrate -b WggMailchimpBundle
Bundle configuration
The bundle currently supports two kind of configuration storage:
Wgg\MailchimpBundle\Storage\FileStorage- stores config as YAML file under
PIMCORE_CONFIGURATION_DIRECTORY
- stores config as YAML file under
Wgg\MailchimpBundle\Storage\SettingsStoreStorage- stores config
through
SettingsStore
- stores config
through
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