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

GetStatus()

GetStatus(string  $transactionID, boolean  $showFailed = false, boolean  $showSent = false, boolean  $showDelivered = false, boolean  $showPending = false, boolean  $showOpened = false, boolean  $showClicked = false, boolean  $showAbuse = false, boolean  $showUnsubscribed = false, boolean  $showErrors = false, boolean  $showMessageIDs = false) : \ElasticEmailEnums\EmailJobStatus

Get email batch status

Parameters

string $transactionID

Transaction identifier

boolean $showFailed

Include Bounced email addresses.

boolean $showSent

Include Sent email addresses.

boolean $showDelivered

Include all delivered email addresses.

boolean $showPending

Include Ready to send email addresses.

boolean $showOpened

Include Opened email addresses.

boolean $showClicked

Include Clicked email addresses.

boolean $showAbuse

Include Reported as abuse email addresses.

boolean $showUnsubscribed

Include Unsubscribed email addresses.

boolean $showErrors

Include error messages for bounced emails.

boolean $showMessageIDs

Include all MessageIDs for this transaction

Returns

\ElasticEmailEnums\EmailJobStatus

Send()

Send(string  $subject = null, string  $from = null, string  $fromName = null, string  $sender = null, string  $senderName = null, string  $msgFrom = null, string  $msgFromName = null, string  $replyTo = null, string  $replyToName = null, \ElasticEmailApi\array<string>  $to = array(), \ElasticEmailApi\array<string>  $msgTo = array(), \ElasticEmailApi\array<string>  $msgCC = array(), \ElasticEmailApi\array<string>  $msgBcc = array(), \ElasticEmailApi\array<string>  $lists = array(), \ElasticEmailApi\array<string>  $segments = array(), string  $mergeSourceFilename = null, string  $dataSource = null, string  $channel = null, string  $bodyHtml = null, string  $bodyText = null, string  $charset = null, string  $charsetBodyHtml = null, string  $charsetBodyText = null, \ElasticEmailEnums\EncodingType  $encodingType = \ElasticEmailEnums\EncodingType::None, string  $template = null, \ElasticEmailApi\array<File>  $attachmentFiles = array(), array  $headers = array(), string  $postBack = null, array  $merge = array(), string  $timeOffSetMinutes = null, string  $poolName = null, boolean  $isTransactional = false, \ElasticEmailApi\array<string>  $attachments = array(), \ElasticEmailApi\?bool  $trackOpens = null, \ElasticEmailApi\?bool  $trackClicks = null) : \ElasticEmailEnums\EmailSend

Submit emails. The HTTP POST request is suggested. The default, maximum (accepted by us) size of an email is 10 MB in total, with or without attachments included. For suggested implementations please refer to https://elasticemail.com/support/http-api/

Parameters

string $subject

Email subject

string $from

From email address

string $fromName

Display name for from email address

string $sender

Email address of the sender

string $senderName

Display name sender

string $msgFrom

Optional parameter. Sets FROM MIME header.

string $msgFromName

Optional parameter. Sets FROM name of MIME header.

string $replyTo

Email address to reply to

string $replyToName

Display name of the reply to address

\ElasticEmailApi\array $to

List of email recipients (each email is treated separately, like a BCC). Separated by comma or semicolon. We suggest using the "msgTo" parameter if backward compatibility with API version 1 is not a must.

\ElasticEmailApi\array $msgTo

Optional parameter. Will be ignored if the 'to' parameter is also provided. List of email recipients (visible to all other recipients of the message as TO MIME header). Separated by comma or semicolon.

\ElasticEmailApi\array $msgCC

Optional parameter. Will be ignored if the 'to' parameter is also provided. List of email recipients (visible to all other recipients of the message as CC MIME header). Separated by comma or semicolon.

\ElasticEmailApi\array $msgBcc

Optional parameter. Will be ignored if the 'to' parameter is also provided. List of email recipients (each email is treated seperately). Separated by comma or semicolon.

\ElasticEmailApi\array $lists

The name of a contact list you would like to send to. Separate multiple contact lists by commas or semicolons.

\ElasticEmailApi\array $segments

The name of a segment you would like to send to. Separate multiple segments by comma or semicolon. Insert "0" for all Active contacts.

string $mergeSourceFilename

File name one of attachments which is a CSV list of Recipients.

string $dataSource

Name or ID of the previously uploaded file which should be a CSV list of Recipients.

string $channel

An ID field (max 191 chars) that can be used for reporting [will default to HTTP API or SMTP API]

string $bodyHtml

Html email body

string $bodyText

Text email body

string $charset

Text value of charset encoding for example: iso-8859-1, windows-1251, utf-8, us-ascii, windows-1250 and more…

string $charsetBodyHtml

Sets charset for body html MIME part (overrides default value from charset parameter)

string $charsetBodyText

Sets charset for body text MIME part (overrides default value from charset parameter)

\ElasticEmailEnums\EncodingType $encodingType

0 for None, 1 for Raw7Bit, 2 for Raw8Bit, 3 for QuotedPrintable, 4 for Base64 (Default), 5 for Uue note that you can also provide the text version such as "Raw7Bit" for value 1. NOTE: Base64 or QuotedPrintable is recommended if you are validating your domain(s) with DKIM.

string $template

The ID of an email template you have created in your account.

\ElasticEmailApi\array $attachmentFiles

Attachment files. These files should be provided with the POST multipart file upload, not directly in the request's URL. Can also include merge CSV file

array $headers
string $postBack

Optional header returned in notifications.

array $merge
string $timeOffSetMinutes

Number of minutes in the future this email should be sent up to a maximum of 1 year (524160 minutes)

string $poolName

Name of your custom IP Pool to be used in the sending process

boolean $isTransactional

True, if email is transactional (non-bulk, non-marketing, non-commercial). Otherwise, false

\ElasticEmailApi\array $attachments

Names or IDs of attachments previously uploaded to your account that should be sent with this e-mail.

\ElasticEmailApi\?bool $trackOpens

Should the opens be tracked? If no value has been provided, account's default setting will be used.

\ElasticEmailApi\?bool $trackClicks

Should the clicks be tracked? If no value has been provided, account's default setting will be used.

Returns

\ElasticEmailEnums\EmailSend

Status()

Status(string  $messageID) : \ElasticEmailEnums\EmailStatus

Detailed status of a unique email sent through your account. Returns a 'Email has expired and the status is unknown.' error, if the email has not been fully processed yet.

Parameters

string $messageID

Unique identifier for this email.

Returns

\ElasticEmailEnums\EmailStatus

View()

View(string  $messageID) : \ElasticEmailEnums\EmailView

View email

Parameters

string $messageID

Message identifier

Returns

\ElasticEmailEnums\EmailView

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