Properties

$type

$type : string

Type of log (e.g., "email").

Type

string

$action

$action : string

The action logged (e.g., "send").

Type

string

$rawResponse

$rawResponse : mixed

The mailer's raw response.

Type

mixed

$messageId

$messageId : string

The Message-ID (Unique message identifier)

Type

string

$campaign

$campaign : string

The campaign ID.

Type

string

$from

$from : string

The sender's email address.

Type

string

$to

$to : string

The recipient's email address.

Type

string

$subject

$subject : string

The email subject.

Type

string

$sendStatus

$sendStatus : integer

Whether the email has been semt.

Error code (0 = success)

Type

integer

$sendError

$sendError : string

The error message from a failed send.

Type

string

$sendDate

$sendDate : \DateTime

When the email should be sent.

Type

\DateTime

$ip

$ip : string

The current IP address at the time of the log.

Type

string

$sessionId

$sessionId : string

The current session ID at the time of the log.

Type

string

Methods

key()

key() : string

Get the primary key that uniquely identifies each queue item.

Returns

string

setType()

setType(string  $type) : \Charcoal\Email\EmailLog

Set the type of log.

Parameters

string $type

The log type. (e.g., "email").

Throws

\InvalidArgumentException

If the log type is not a string.

Returns

\Charcoal\Email\EmailLog

Chainable

type()

type() : string

Get the log type.

Returns

string

setAction()

setAction(string  $action) : \Charcoal\Email\EmailLog

Set the logged action.

Parameters

string $action

The log action (e.g., "send").

Throws

\InvalidArgumentException

If the action is not a string.

Returns

\Charcoal\Email\EmailLog

Chainable

action()

action() : string

Get the logged action.

Returns

string

setRawResponse()

setRawResponse(mixed  $res) : \Charcoal\Email\EmailLog

Set the raw response from the mailer.

Parameters

mixed $res

The response object or array.

Returns

\Charcoal\Email\EmailLog

Chainable

rawResponse()

rawResponse() : mixed

Get the raw response from the mailer.

Returns

mixed

setMessageId()

setMessageId(string  $messageId) : \Charcoal\Email\EmailLog

Set the Message-ID.

Parameters

string $messageId

The Message-ID.

Throws

\InvalidArgumentException

If the Message-ID is not a string.

Returns

\Charcoal\Email\EmailLog

Chainable

messageId()

messageId() : string

Get the Message-ID.

Returns

string

setCampaign()

setCampaign(string  $campaign) : \Charcoal\Email\EmailInterface

Set the campaign ID.

Parameters

string $campaign

The campaign identifier.

Throws

\InvalidArgumentException

If the campaign is invalid.

Returns

\Charcoal\Email\EmailInterface

Chainable

campaign()

campaign() : string

Get the campaign identifier.

Returns

string

setFrom()

setFrom(string|array  $email) : \Charcoal\Email\EmailLog

Set the sender's email address.

Parameters

string|array $email

An email address.

Throws

\InvalidArgumentException

If the email address is invalid.

Returns

\Charcoal\Email\EmailLog

Chainable

from()

from() : string

Get the sender's email address.

Returns

string

setTo()

setTo(string|array  $email) : \Charcoal\Email\EmailLog

Set the recipient's email address.

Parameters

string|array $email

An email address.

Throws

\InvalidArgumentException

If the email address is invalid.

Returns

\Charcoal\Email\EmailLog

Chainable

to()

to() : string

Get the recipient's email address.

Returns

string

setSubject()

setSubject(string  $subject) : \Charcoal\Email\EmailLog

Set the email subject.

Parameters

string $subject

The email subject.

Throws

\InvalidArgumentException

If the subject is not a string.

Returns

\Charcoal\Email\EmailLog

Chainable

subject()

subject() : string

Get the email subject.

Returns

string

setSendDate()

setSendDate(null|string|\DateTime  $ts) : \Charcoal\Email\EmailLog

Parameters

null|string|\DateTime $ts

The "send date" datetime value.

Throws

\InvalidArgumentException

If the ts is not a valid datetime value.

Returns

\Charcoal\Email\EmailLog

Chainable

sendDate()

sendDate() : null|\DateTimeInterface

Returns

null|\DateTimeInterface

setIp()

setIp(mixed  $ip) : \Charcoal\Email\EmailLog

Parameters

mixed $ip

The IP adress.

Returns

\Charcoal\Email\EmailLog

Chainable

ip()

ip() : mixed

Returns

mixed

setSessionId()

setSessionId(string  $sessionId) : \Charcoal\Email\EmailLog

Parameters

string $sessionId

The session identifier.

Returns

\Charcoal\Email\EmailLog

Chainable

sessionId()

sessionId() : string

Returns

string

preSave()

preSave() : boolean

Returns

boolean

emailToArray()

emailToArray(mixed  $var) : string

Convert an email address (RFC822) into a proper array notation.

Parameters

mixed $var

An email array (containing an "email" key and optionally a "name" key).

Throws

\InvalidArgumentException

If the email is invalid.

Returns

string

emailFromArray()

emailFromArray(array  $arr) : string

Convert an email address array to a RFC-822 string notation.

Parameters

array $arr

An email array (containing an "email" key and optionally a "name" key).

Throws

\InvalidArgumentException

If the email array is invalid.

Returns

string