Methods summary
public
|
#
__construct( )
Initialize EmailVerifications
Initialize EmailVerifications
Overrides
|
public
mixed
|
#
get( integer $verification_id )
Fetches the given email verification
Fetches the given email verification
Parameters
- $verification_id
- The ID of the email verification to fetch
Returns
mixed A stdClass object containing the email verification information,
false if no such email verification exists
|
public
array
|
#
getAll( array $filters = [] )
Fetches all the email verifications on the system
Fetches all the email verifications on the system
Parameters
- $filters
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
Returns
array An array of stdClass objects containing the email verification information
|
public
mixed
|
#
getByToken( string $token )
Fetches the given email verification by their token
Fetches the given email verification by their token
Parameters
- $token
- The token of the email verification to fetch
Returns
mixed A stdClass object containing the email verification information,
false if no such email verification exists
|
public
mixed
|
#
getByContactId( integer $contact_id )
Fetches the latest email verification by their contact ID
Fetches the latest email verification by their contact ID
Parameters
- $contact_id
- The ID of the contact on which to fetch the latest email verification
Returns
mixed A stdClass object containing the email verification information,
false if no such email verification exists
|
public
integer
|
#
add( array $vars, boolean $send = true )
Creates a new email verification using the given data
Creates a new email verification using the given data
Parameters
- $vars
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
- Whether or not to send the verification email to the client (optional, true by default)
Returns
integer The email verification ID, void on error
|
public
integer
|
#
edit( integer $verification_id, array $vars )
Updates an email verification using the given data
Updates an email verification using the given data
Parameters
- $verification_id
- The ID of the email verification to update
- $vars
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
Returns
integer The email verification ID, void on error
|
public
|
#
delete( integer $verification_id )
Permanently removes an email verification from the system
Permanently removes an email verification from the system
Parameters
- $verification_id
- The ID of the email verification to delete
|
public
|
#
deleteAll( integer $contact_id )
Permanently removes all email verifications from a specific contact
Permanently removes all email verifications from a specific contact
Parameters
- $contact_id
- The ID of the contact to delete all verifications
|
public
|
#
verify( integer $verification_id )
Verifies an email address
Verifies an email address
Parameters
- $verification_id
- The ID of the email verification to set as verified
|
public
string
|
#
generateToken( string $email )
Generates a new token based on the given email address
Generates a new token based on the given email address
Parameters
- $email
- The email address to generate a verification token
Returns
string The verification token
|
public
|
#
send( integer $verification_id )
Sends the email verification link
Sends the email verification link
Parameters
- $verification_id
- The ID of the email verification link to send
|