IMP_Sentmail
in package
The abstract class that all sentmail implementations inherit from.
Tags
Table of Contents
Constants
Properties
- $limit_period : int
- $threshold : int
- $_params : array<string|int, mixed>
- Hash containing configuration parameters.
Methods
- __construct() : mixed
- Constructor.
- __get() : mixed
- favouriteRecipients() : array<string|int, mixed>
- Returns the favourite recipients.
- gc() : mixed
- Garbage collect log entries.
- log() : mixed
- Logs an attempt to send a message.
- numberOfRecipients() : int
- Returns the number of recipients within a certain time period.
- _deleteOldEntries() : mixed
- Deletes all log entries older than a certain date.
- _log() : mixed
- Logs an attempt to send a message per recipient.
Constants
FORWARD
public
mixed
FORWARD
= 'forward'
MDN
public
mixed
MDN
= 'mdn'
NEWMSG
public
mixed
NEWMSG
= 'new'
REDIRECT
public
mixed
REDIRECT
= 'redirect'
REPLY
public
mixed
REPLY
= 'reply'
Properties
$limit_period read-only
public
int
$limit_period
If limiting recipients per time period, how many hours should this period last?
$threshold read-only
public
int
$threshold
How many days should old log entries be kept?
$_params
Hash containing configuration parameters.
protected
array<string|int, mixed>
$_params
= array()
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $params : array<string|int, mixed> = array()
-
Configuration parameters the driver needs.
Tags
__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
favouriteRecipients()
Returns the favourite recipients.
public
abstract favouriteRecipients(int $limit[, mixed $filter = null ]) : array<string|int, mixed>
Parameters
- $limit : int
-
Return this number of recipients.
- $filter : mixed = null
-
A list of messages types that should be returned. Null returns all message types.
Return values
array<string|int, mixed> —A list with the $limit most favourite recipients.
gc()
Garbage collect log entries.
public
gc() : mixed
log()
Logs an attempt to send a message.
public
log(int $action, string $message_id, string|array<string|int, mixed> $recipients[, bool $success = true ]) : mixed
Parameters
- $action : int
-
Why the message was sent (IMP_Sentmail constant).
- $message_id : string
-
The Message-ID.
- $recipients : string|array<string|int, mixed>
-
The list of message recipients.
- $success : bool = true
-
Whether the attempt was successful.
numberOfRecipients()
Returns the number of recipients within a certain time period.
public
abstract numberOfRecipients(int $hours[, bool $user = false ]) : int
Parameters
- $hours : int
-
Time period in hours.
- $user : bool = false
-
Return the number of recipients for the current user?
Return values
int —The number of recipients in the given time period.
_deleteOldEntries()
Deletes all log entries older than a certain date.
protected
abstract _deleteOldEntries(int $before) : mixed
Parameters
- $before : int
-
Unix timestamp before that all log entries should be deleted.
_log()
Logs an attempt to send a message per recipient.
protected
abstract _log(int $action, string $message_id, string $recipient, bool $success) : mixed
Parameters
- $action : int
-
Why the message was sent (IMP_Sentmail constant).
- $message_id : string
-
The Message-ID.
- $recipient : string
-
A message recipient.
- $success : bool
-
Whether the attempt was successful.