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_AFTER_DELETE
public
mixed
EVENT_AFTER_DELETE
= 'event_after_delete'
EVENT_AFTER_SAVE
public
mixed
EVENT_AFTER_SAVE
= 'event_after_save'
EVENT_AFTER_SEND
public
mixed
EVENT_AFTER_SEND
= 'event_after_send'
EVENT_BEFORE_DELETE
public
mixed
EVENT_BEFORE_DELETE
= 'event_before_delete'
EVENT_BEFORE_SAVE
public
mixed
EVENT_BEFORE_SAVE
= 'event_before_save'
EVENT_BEFORE_SEND
public
mixed
EVENT_BEFORE_SEND
= 'event_before_send'
Properties
$lastRunResult
Result of shot after being sent, contains succeeded and failed email addresses
public
array<string|int, mixed>
$lastRunResult
= []
$_shots
protected
array<string|int, EmailShot>
$_shots
= null
Methods
delete()
Delete an email shot
public
delete(EmailShot $shot) : bool
Parameters
- $shot : EmailShot
Return values
bool —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> —getByHandle()
Get email shot by handle
public
getByHandle(string $handle) : EmailShot
Parameters
- $handle : string
Return values
EmailShot —getById()
Get email shot by id
public
getById(int $id) : EmailShot
Parameters
- $id : int
Return values
EmailShot —getLogById()
Get a log by id
public
getLogById(int $id) : EmailShotLog
Parameters
- $id : int
Return values
EmailShotLog —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> —getRecordById()
Get email shot record by id
public
getRecordById(int $id) : EmailShot
Parameters
- $id : int
Return values
EmailShot —save()
Save an email shot
public
save(EmailShot $shot[, bool $validate = true ]) : bool
Parameters
- $shot : EmailShot
- $validate : bool = true
Return values
bool —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 —sendNow()
Send email shot now
public
sendNow(EmailShot $shot) : bool
Parameters
- $shot : EmailShot
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