Properties

$configuration

$configuration : \ElasticEmailClient\ApiConfiguration

Type

\ElasticEmailClient\ApiConfiguration — ApiConfiguration

$httpClient

$httpClient : \GuzzleHttp\ClientInterface

Type

\GuzzleHttp\ClientInterface

Methods

__construct()

__construct(\ElasticEmailClient\ApiConfiguration  $apiConfiguration) 

Parameters

\ElasticEmailClient\ApiConfiguration $apiConfiguration

setHttpClient()

setHttpClient(  $client) 

Parameters

$client

getHttpClient()

getHttpClient() : \GuzzleHttp\ClientInterface

Returns

\GuzzleHttp\ClientInterface

setConfiguration()

setConfiguration(\ElasticEmailClient\ApiConfiguration  $config) : $this

Parameters

\ElasticEmailClient\ApiConfiguration $config

Returns

$this

getConfiguration()

getConfiguration() : \ElasticEmailClient\ApiConfiguration

Returns

\ElasticEmailClient\ApiConfiguration

Add()

Add(string  $listName, boolean  $createEmptyList = false, boolean  $allowUnsubscribe = false, string  $rule = null, \ElasticEmailApi\array<string>  $emails = array(), boolean  $allContacts = false) : integer

Create new list, based on filtering rule or list of IDs

Parameters

string $listName

Name of your list.

boolean $createEmptyList

True to create an empty list, otherwise false. Ignores rule and emails parameters if provided.

boolean $allowUnsubscribe

True: Allow unsubscribing from this list. Otherwise, false

string $rule

Query used for filtering.

\ElasticEmailApi\array $emails

Comma delimited list of contact emails

boolean $allContacts

True: Include every Contact in your Account. Otherwise, false

Returns

integer

AddContacts()

AddContacts(string  $listName, string  $rule = null, \ElasticEmailApi\array<string>  $emails = array(), boolean  $allContacts = false) 

Add existing Contacts to chosen list

Parameters

string $listName

Name of your list.

string $rule

Query used for filtering.

\ElasticEmailApi\array $emails

Comma delimited list of contact emails

boolean $allContacts

True: Include every Contact in your Account. Otherwise, false

EECopy()

EECopy(string  $sourceListName, string  $newlistName = null, \ElasticEmailApi\?bool  $createEmptyList = null, \ElasticEmailApi\?bool  $allowUnsubscribe = null, string  $rule = null) : integer

Copy your existing List with the option to provide new settings to it. Some fields, when left empty, default to the source list's settings

Parameters

string $sourceListName

The name of the list you want to copy

string $newlistName

Name of your list if you want to change it.

\ElasticEmailApi\?bool $createEmptyList

True to create an empty list, otherwise false. Ignores rule and emails parameters if provided.

\ElasticEmailApi\?bool $allowUnsubscribe

True: Allow unsubscribing from this list. Otherwise, false

string $rule

Query used for filtering.

Returns

integer

CreateFromCampaign()

CreateFromCampaign(integer  $campaignID, string  $listName, \ElasticEmailApi\array<\ElasticEmailEnums\LogJobStatus>  $statuses = array()) : integer

Create a new list from the recipients of the given campaign, using the given statuses of Messages

Parameters

integer $campaignID

ID of the campaign which recipients you want to copy

string $listName

Name of your list.

\ElasticEmailApi\array<\ElasticEmailEnums\LogJobStatus> $statuses

Statuses of a campaign's emails you want to include in the new list (but NOT the contacts' statuses)

Returns

integer

CreateNthSelectionLists()

CreateNthSelectionLists(string  $listName, integer  $numberOfLists, boolean  $excludeBlocked = true, boolean  $allowUnsubscribe = false, string  $rule = null, boolean  $allContacts = false) 

Create a series of nth selection lists from an existing list or segment

Parameters

string $listName

Name of your list.

integer $numberOfLists

The number of evenly distributed lists to create.

boolean $excludeBlocked

True if you want to exclude contacts that are currently in a blocked status of either unsubscribe, complaint or bounce. Otherwise, false.

boolean $allowUnsubscribe

True: Allow unsubscribing from this list. Otherwise, false

string $rule

Query used for filtering.

boolean $allContacts

True: Include every Contact in your Account. Otherwise, false

CreateRandomList()

CreateRandomList(string  $listName, integer  $count, boolean  $excludeBlocked = true, boolean  $allowUnsubscribe = false, string  $rule = null, boolean  $allContacts = false) : integer

Create a new list with randomized contacts from an existing list or segment

Parameters

string $listName

Name of your list.

integer $count

Number of items.

boolean $excludeBlocked

True if you want to exclude contacts that are currently in a blocked status of either unsubscribe, complaint or bounce. Otherwise, false.

boolean $allowUnsubscribe

True: Allow unsubscribing from this list. Otherwise, false

string $rule

Query used for filtering.

boolean $allContacts

True: Include every Contact in your Account. Otherwise, false

Returns

integer

EEDelete()

EEDelete(string  $listName) 

Deletes List and removes all the Contacts from it (does not delete Contacts).

Parameters

string $listName

Name of your list.

Export()

Export(string  $listName, \ElasticEmailEnums\ExportFileFormats  $fileFormat = \ElasticEmailEnums\ExportFileFormats::Csv, \ElasticEmailEnums\CompressionFormat  $compressionFormat = \ElasticEmailEnums\CompressionFormat::None, string  $fileName = null) : \ElasticEmailEnums\ExportLink

Exports all the contacts from the provided list

Parameters

string $listName

Name of your list.

\ElasticEmailEnums\ExportFileFormats $fileFormat

Format of the exported file

\ElasticEmailEnums\CompressionFormat $compressionFormat

FileResponse compression format. None or Zip.

string $fileName

Name of your file.

Returns

\ElasticEmailEnums\ExportLink

EElist()

EElist(\ElasticEmailApi\?DateTime  $from = null, \ElasticEmailApi\?DateTime  $to = null) : \ElasticEmailApi\Array<\ElasticEmailEnums\List>

Shows all your existing lists

Parameters

\ElasticEmailApi\?DateTime $from

Starting date for search in YYYY-MM-DDThh:mm:ss format.

\ElasticEmailApi\?DateTime $to

Ending date for search in YYYY-MM-DDThh:mm:ss format.

Returns

\ElasticEmailApi\Array<\ElasticEmailEnums\List>

Load()

Load(string  $listName) : \ElasticEmailEnums\List

Returns detailed information about specific list.

Parameters

string $listName

Name of your list.

Returns

\ElasticEmailEnums\List

MoveContacts()

MoveContacts(string  $oldListName, string  $newListName, \ElasticEmailApi\array<string>  $emails = array(), \ElasticEmailApi\?bool  $moveAll = null, \ElasticEmailApi\array<\ElasticEmailEnums\ContactStatus>  $statuses = array(), string  $rule = null) 

Move selected contacts from one List to another

Parameters

string $oldListName

The name of the list from which the contacts will be copied from

string $newListName

The name of the list to copy the contacts to

\ElasticEmailApi\array $emails

Comma delimited list of contact emails

\ElasticEmailApi\?bool $moveAll

TRUE - moves all contacts; FALSE - moves contacts provided in the 'emails' parameter. This is ignored if the 'statuses' parameter has been provided

\ElasticEmailApi\array<\ElasticEmailEnums\ContactStatus> $statuses

List of contact statuses which are eligible to move. This ignores the 'moveAll' parameter

string $rule

Query used for filtering.

RemoveContacts()

RemoveContacts(string  $listName, string  $rule = null, \ElasticEmailApi\array<string>  $emails = array()) 

Remove selected Contacts from your list

Parameters

string $listName

Name of your list.

string $rule

Query used for filtering.

\ElasticEmailApi\array $emails

Comma delimited list of contact emails

Update()

Update(string  $listName, string  $newListName = null, boolean  $allowUnsubscribe = false) 

Update existing list

Parameters

string $listName

Name of your list.

string $newListName

Name of your list if you want to change it.

boolean $allowUnsubscribe

True: Allow unsubscribing from this list. Otherwise, false

sendRequest()

sendRequest(string  $url, array  $data = array(), string  $method = 'POST', array  $attachments = array()) : \Psr\Http\Message\ResponseInterface

Parameters

string $url
array $data
string $method
array $attachments

Throws

\Exception

Returns

\Psr\Http\Message\ResponseInterface

parseMultipart()

parseMultipart(array  $attachments, array  $params) : array

Parameters

array $attachments
array $params

Returns

array