Craft Emails (1.x)

EmailShotsService extends Component
in package

Table of Contents

EVENT_AFTER_DELETE  = 'event_after_delete'
EVENT_AFTER_SAVE  = 'event_after_save'
EVENT_AFTER_SEND  = 'event_after_send'
EVENT_BEFORE_DELETE  = 'event_before_delete'
EVENT_BEFORE_SAVE  = 'event_before_save'
EVENT_BEFORE_SEND  = 'event_before_send'
$lastRunResult  : array<string|int, mixed>
Result of shot after being sent, contains succeeded and failed email addresses
$_shots  : array<string|int, EmailShot>
delete()  : bool
Delete an email shot
deleteLogs()  : mixed
Delete logs for an email shot
getAll()  : array<string|int, mixed>
Get all email shots
getByHandle()  : EmailShot
Get email shot by handle
getById()  : EmailShot
Get email shot by id
getLogById()  : EmailShotLog
Get a log by id
getLogs()  : array<string|int, mixed>
Get logs for an email shot
getRecordById()  : EmailShot
Get email shot record by id
save()  : bool
Save an email shot
send()  : bool
Send an email shot
sendNow()  : bool
Send email shot now
afterSend()  : mixed
After sending email shot
triggerEvent()  : mixed
Trigger an event

Constants

EVENT_BEFORE_DELETE

public mixed EVENT_BEFORE_DELETE = 'event_before_delete'

Properties

$lastRunResult

Result of shot after being sent, contains succeeded and failed email addresses

public array<string|int, mixed> $lastRunResult = []

Methods

deleteLogs()

Delete logs for an email shot

public deleteLogs(EmailShot $shot[, array<string|int, mixed>|null $ids = null ]) : mixed
Parameters
$shot : EmailShot
$ids : array<string|int, mixed>|null = null
Return values
mixed

getAll()

Get all email shots

public getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

getLogs()

Get logs for an email shot

public getLogs(EmailShot $shot[, string $order = 'dateCreated' ][, string $orderSide = 'desc' ]) : array<string|int, mixed>
Parameters
$shot : EmailShot
$order : string = 'dateCreated'
$orderSide : string = 'desc'
Return values
array<string|int, mixed>

send()

Send an email shot

public send(EmailShot $shot[,  $forceQueue = null ]) : bool
Parameters
$shot : EmailShot
$forceQueue : = null

Override the email shot useQueue parameter

Return values
bool

afterSend()

After sending email shot

protected afterSend(EmailShot $shot, array<string|int, mixed> $emails) : mixed
Parameters
$shot : EmailShot
$emails : array<string|int, mixed>
Return values
mixed

triggerEvent()

Trigger an event

protected triggerEvent(string $type, Event $event) : mixed
Parameters
$type : string
$event : Event
Return values
mixed

Search results