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  $name, string  $subject, string  $fromEmail, string  $fromName, \ElasticEmailEnums\TemplateType  $templateType = \ElasticEmailEnums\TemplateType::RawHTML, \ElasticEmailEnums\TemplateScope  $templateScope = \ElasticEmailEnums\TemplateScope::EEPrivate, string  $bodyHtml = null, string  $bodyText = null, string  $css = null, integer  $originalTemplateID) : integer

Create new Template. Needs to be sent using POST method

Parameters

string $name

Filename

string $subject

Default subject of email.

string $fromEmail

Default From: email address.

string $fromName

Default From: name.

\ElasticEmailEnums\TemplateType $templateType

0 for API connections

\ElasticEmailEnums\TemplateScope $templateScope

Enum: 0 - private, 1 - public, 2 - mockup

string $bodyHtml

HTML code of email (needs escaping).

string $bodyText

Text body of email.

string $css

CSS style

integer $originalTemplateID

ID number of original template.

Returns

integer

CheckUsage()

CheckUsage(integer  $templateID) : boolean

Check if template is used by campaign.

Parameters

integer $templateID

ID number of template.

Returns

boolean

EECopy()

EECopy(integer  $templateID, string  $name, string  $subject, string  $fromEmail, string  $fromName) : \ElasticEmailEnums\Template

Copy Selected Template

Parameters

integer $templateID

ID number of template.

string $name

Filename

string $subject

Default subject of email.

string $fromEmail

Default From: email address.

string $fromName

Default From: name.

Returns

\ElasticEmailEnums\Template

EEDelete()

EEDelete(integer  $templateID) 

Delete template with the specified ID

Parameters

integer $templateID

ID number of template.

GetEmbeddedHtml()

GetEmbeddedHtml(integer  $templateID) : string

Search for references to images and replaces them with base64 code.

Parameters

integer $templateID

ID number of template.

Returns

string

GetList()

GetList(integer  $limit = 500, integer  $offset) : \ElasticEmailEnums\TemplateList

Lists your templates

Parameters

integer $limit

Maximum of loaded items.

integer $offset

How many items should be loaded ahead.

Returns

\ElasticEmailEnums\TemplateList

LoadTemplate()

LoadTemplate(integer  $templateID, boolean  $ispublic = false) : \ElasticEmailEnums\Template

Load template with content

Parameters

integer $templateID

ID number of template.

boolean $ispublic

Returns

\ElasticEmailEnums\Template

RemoveScreenshot()

RemoveScreenshot(integer  $templateID) 

Removes previously generated screenshot of template

Parameters

integer $templateID

ID number of template.

SaveScreenshot()

SaveScreenshot(string  $base64Image, integer  $templateID) : string

Saves screenshot of chosen Template

Parameters

string $base64Image

Image, base64 coded.

integer $templateID

ID number of template.

Returns

string

Update()

Update(integer  $templateID, \ElasticEmailEnums\TemplateScope  $templateScope = \ElasticEmailEnums\TemplateScope::EEPrivate, string  $name = null, string  $subject = null, string  $fromEmail = null, string  $fromName = null, string  $bodyHtml = null, string  $bodyText = null, string  $css = null, boolean  $removeScreenshot = true) 

Update existing template, overwriting existing data. Needs to be sent using POST method.

Parameters

integer $templateID

ID number of template.

\ElasticEmailEnums\TemplateScope $templateScope

Enum: 0 - private, 1 - public, 2 - mockup

string $name

Filename

string $subject

Default subject of email.

string $fromEmail

Default From: email address.

string $fromName

Default From: name.

string $bodyHtml

HTML code of email (needs escaping).

string $bodyText

Text body of email.

string $css

CSS style

boolean $removeScreenshot

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