Email
in package
Handles a single email notification.
Sends and logs plugin email notifications.
Tags
Table of Contents
Properties
- $client_id : int
- The ID of the client.
- $content : string
- Email content.
- $created_at : string
- The time created.
- $ID : int
- The ID of the email record.
- $key : string
- The email template key.
- $sent : bool
- Whether the email was sent successfully.
- $subject : string
- Email subject.
Methods
- __construct() : mixed
- Constructor method.
- cleanup_database() : mixed
- Cleans up email log.
- get_all_emails() : mixed
- Retrieves all Email objects.
- get_email() : mixed
- Retrieves an Email object by ID.
Properties
$client_id
The ID of the client.
public
int
$client_id
$content
Email content.
public
string
$content
$created_at
The time created.
public
string
$created_at
$ID
The ID of the email record.
public
int
$ID
$key
The email template key.
public
string
$key
$sent
Whether the email was sent successfully.
public
bool
$sent
$subject
Email subject.
public
string
$subject
Methods
__construct()
Constructor method.
public
__construct(mixed $key, array<string|int, mixed> $args) : mixed
Parameters
- $key : mixed
- $args : array<string|int, mixed>
-
{ An array of email arguments. Must include 'to_email' or 'to_user_id'. Include additional args to replace variables in email templates.
@type string $to_email To email address. @type string $to_user_id The user to whom the email is being sent. @type string $reply_to Optional. Reply-to email address. @type string $bcc Optional. BCC email address. @type bool $do_not_log Optional. Include to stop logging mechanism.}
Tags
cleanup_database()
Cleans up email log.
public
static cleanup_database() : mixed
Tags
get_all_emails()
Retrieves all Email objects.
public
static get_all_emails() : mixed
Tags
get_email()
Retrieves an Email object by ID.
public
static get_email(int $email_id) : mixed
Parameters
- $email_id : int
-
The ID of the Email.