Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
namespace Wgg\MailchimpBundle\Util;
use MailchimpMarketing\Api\ListsApi;
use MailchimpMarketing\Api\PingApi;
use MailchimpMarketing\ApiClient as BaseApiClient;
use function mb_strtolower;
use function md5;
* @property ListsApi $lists
* @property PingApi $ping
class ApiClient extends BaseApiClient
private ?array $listIds;
public function __construct(MailchimpConfiguration $configuration)
$config = $configuration->readConfig();
'apiKey' => $config['api_key'],
'server' => $config['server_prefix'],
$this->listIds = $config['list_id'];
public function getListIds(): ?array
return $this->listIds;
public function addListMember(string $listId, string $email, string $name, string $language): void
$subscriberHash = md5(mb_strtolower($email));
'email_address' => $email,
'status_if_new' => 'pending',
'status' => 'subscribed',
'language' => $language,
'merge_fields' => [
'NAME' => $name,