EmailVerifications extends AppModel
Email Verifications management
Table of Contents
Properties
| $client_uri |
Methods
| __construct() | Initialize EmailVerifications |
| add() | Creates a new email verification using the given data |
| delete() | Permanently removes an email verification from the system |
| deleteAll() | Permanently removes all email verifications from a specific contact |
| edit() | Updates an email verification using the given data |
| generateToken() | Generates a new token based on the given email address |
| get() | Fetches the given email verification |
| getAll() | Fetches all the email verifications on the system |
| getByContactId() | Fetches the latest email verification by their contact ID |
| getByToken() | Fetches the given email verification by their token |
| send() | Sends the email verification link |
| verify() | Verifies an email address |
| getRules() | Returns the rule set for adding/editing invoices |
Methods
__construct()
Initialize EmailVerifications
public
__construct() : mixed
add()
Creates a new email verification using the given data
public
add(array<string|int, mixed> $vars[, bool $send = true ]) : int
Parameters
- $vars : array<string|int, mixed>
-
An array of invoice data including:
- contact_id The ID of the contact to verify
- email The email address to verify
- token The email verification token (optional, If not given a token will be automatically generated)
- verified Whether or not the email it's verified, (optional, 0 by default)
- redirect_url The url to redirect after a successfully verification
- $send : bool = true
-
Whether or not to send the verification email to the client (optional, true by default)
Return values
int —The email verification ID, void on error
delete()
Permanently removes an email verification from the system
public
delete(int $verification_id) : mixed
Parameters
- $verification_id : int
-
The ID of the email verification to delete
deleteAll()
Permanently removes all email verifications from a specific contact
public
deleteAll(int $contact_id) : mixed
Parameters
- $contact_id : int
-
The ID of the contact to delete all verifications
edit()
Updates an email verification using the given data
public
edit(int $verification_id, array<string|int, mixed> $vars) : int
Parameters
- $verification_id : int
-
The ID of the email verification to update
- $vars : array<string|int, mixed>
-
An array of invoice data including:
- contact_id The ID of the contact to verify
- email The email address to verify
- token The email verification token
- verified Whether or not the email it's verified
- redirect_url The url to redirect after a successfully verification
Return values
int —The email verification ID, void on error
generateToken()
Generates a new token based on the given email address
public
generateToken(string $email) : string
Parameters
- $email : string
-
The email address to generate a verification token
Return values
string —The verification token
get()
Fetches the given email verification
public
get(int $verification_id) : mixed
Parameters
- $verification_id : int
-
The ID of the email verification to fetch
Return values
mixed —A stdClass object containing the email verification information, false if no such email verification exists
getAll()
Fetches all the email verifications on the system
public
getAll([array<string|int, mixed> $filters = [] ]) : array<string|int, mixed>
Parameters
- $filters : array<string|int, mixed> = []
-
A list of parameters to filter by, including:
- contact_id The ID of the contact on which to filter email verifications
- email The email address on which to filter email verifications
- verified The status type of the email verification to fetch (optional, default null) one of the following:
- 1 Fetch only verified rows
- 0 Fetch only unverified rows
- null Fetch all rows
- date_sent
Return values
array<string|int, mixed> —An array of stdClass objects containing the email verification information
getByContactId()
Fetches the latest email verification by their contact ID
public
getByContactId(int $contact_id) : mixed
Parameters
- $contact_id : int
-
The ID of the contact on which to fetch the latest email verification
Return values
mixed —A stdClass object containing the email verification information, false if no such email verification exists
getByToken()
Fetches the given email verification by their token
public
getByToken(string $token) : mixed
Parameters
- $token : string
-
The token of the email verification to fetch
Return values
mixed —A stdClass object containing the email verification information, false if no such email verification exists
send()
Sends the email verification link
public
send(int $verification_id) : mixed
Parameters
- $verification_id : int
-
The ID of the email verification link to send
verify()
Verifies an email address
public
verify(int $verification_id) : mixed
Parameters
- $verification_id : int
-
The ID of the email verification to set as verified
getRules()
Returns the rule set for adding/editing invoices
private
getRules(array<string|int, mixed> $vars[, mixed $edit = false ]) : array<string|int, mixed>
Parameters
- $vars : array<string|int, mixed>
-
The input vars
- $edit : mixed = false
Return values
array<string|int, mixed> —The email verification rules