Mailer
in package
Email Service Provider
Handles email sending functionality using PHPMailer library. Configured to work with AlwaysData SMTP server for sending password reset emails and other application notifications. All emails are sent in plain text format only.
Tags
Table of Contents
Properties
- $from_email : string
- Sender email address
- $from_name : string
- Sender display name
Methods
- __construct() : mixed
- sendEmailVerificationCodeEmail() : bool
- Send an email verification code for email change
- sendPasswordChangeCodeEmail() : bool
- Send a password change verification code email
- sendPasswordResetEmail() : bool
- Send a password reset email
- sendSecurityAlertEmail() : bool
- Send a security alert email for suspicious activity
- sendTeamConfirmedEmail() : bool
- Send a notification email to the group creator when all members confirmed
- sendTeamInvitationEmail() : bool
- Send a team invitation email for group registration
- sendVerificationEmail() : bool
- Send a verification email
- getEmailVerificationCodeText() : string
- Generate email content for email verification code operations
- getPasswordChangeCodeEmailText() : string
- Generate email content for password change verification code operations
- getPasswordResetEmailText() : string
- Generate email content for password reset operations
- getSecurityAlertEmailText() : string
- Generate email content for security alert operations
- getTeamConfirmedEmailText() : string
- Generate email content for team confirmed notification operations
- getTeamInvitationEmailText() : string
- Generate email content for team invitation operations
- getVerificationEmailText() : string
- Generate email content for email verification operations
- smtpConfiguration() : void
- Configure SMTP settings for PHPMailer
Properties
$from_email
Sender email address
private
string
$from_email
$from_name
Sender display name
private
string
$from_name
= 'BDELive'
Methods
__construct()
public
__construct() : mixed
sendEmailVerificationCodeEmail()
Send an email verification code for email change
public
sendEmailVerificationCodeEmail(string $to_email, string $to_name, string $code) : bool
Sends a 6-digit verification code to the NEW email address to verify that the email exists and is accessible.
Parameters
- $to_email : string
-
New email address to verify
- $to_name : string
-
Recipient name
- $code : string
-
The 6-digit verification code
Return values
bool —True if email sent successfully, false otherwise
sendPasswordChangeCodeEmail()
Send a password change verification code email
public
sendPasswordChangeCodeEmail(string $to_email, string $to_name, string $code) : bool
Sends a 6-digit verification code for password change confirmation.
Parameters
- $to_email : string
-
Recipient email address
- $to_name : string
-
Recipient name
- $code : string
-
The 6-digit verification code
Return values
bool —True if email sent successfully, false otherwise
sendPasswordResetEmail()
Send a password reset email
public
sendPasswordResetEmail(string $to_email, string $to_name, string $token) : bool
Sends an email with a password reset token.
Parameters
- $to_email : string
-
Recipient email address
- $to_name : string
-
Recipient name
- $token : string
-
Password reset token
Return values
bool —True if email sent successfully, false otherwise
sendSecurityAlertEmail()
Send a security alert email for suspicious activity
public
sendSecurityAlertEmail(string $to_email, string $to_name, string $alertType) : bool
Notifies the user that a suspicious modification attempt was detected and their account has been temporarily blocked.
Parameters
- $to_email : string
-
Recipient email address
- $to_name : string
-
Recipient name
- $alertType : string
-
Type of alert (email_change, password_change)
Return values
bool —True if email sent successfully, false otherwise
sendTeamConfirmedEmail()
Send a notification email to the group creator when all members confirmed
public
sendTeamConfirmedEmail(string $to_email, string $to_name, string $eventName, int $teamNumber) : bool
Notifies the creator that the team is now fully confirmed and registered for the event.
Parameters
- $to_email : string
-
Creator's email address
- $to_name : string
-
Creator's name
- $eventName : string
-
Name of the event
- $teamNumber : int
-
Team/group number
Return values
bool —True if email sent successfully, false otherwise
sendTeamInvitationEmail()
Send a team invitation email for group registration
public
sendTeamInvitationEmail(string $to_email, string $to_name, string $token, string $eventName, string $creatorName, int $teamNumber, int $teamSize) : bool
Sends an email inviting someone to join a team for a group event, with a link to join the team.
Parameters
- $to_email : string
-
Recipient email address
- $to_name : string
-
Recipient name
- $token : string
-
Validation token
- $eventName : string
-
Name of the event
- $creatorName : string
-
Name of the team creator
- $teamNumber : int
-
Team number
- $teamSize : int
-
Total team size
Return values
bool —True if email sent successfully, false otherwise
sendVerificationEmail()
Send a verification email
public
sendVerificationEmail(string $to_email, string $to_name, string $token) : bool
Sends an email with a verification link to activate the user's account.
Parameters
- $to_email : string
-
Recipient email address
- $to_name : string
-
Recipient name
- $token : string
-
Verification token
Return values
bool —True if email sent successfully, false otherwise
getEmailVerificationCodeText()
Generate email content for email verification code operations
private
getEmailVerificationCodeText(string $name, string $code) : string
Parameters
- $name : string
-
Recipient name
- $code : string
-
The 6-digit verification code
Return values
string —Email content
getPasswordChangeCodeEmailText()
Generate email content for password change verification code operations
private
getPasswordChangeCodeEmailText(string $name, string $code) : string
Parameters
- $name : string
-
Recipient name
- $code : string
-
The 6-digit verification code
Return values
string —Email content
getPasswordResetEmailText()
Generate email content for password reset operations
private
getPasswordResetEmailText(string $name, string $token) : string
Parameters
- $name : string
-
Recipient name
- $token : string
-
Password reset token
Return values
string —Email content
getSecurityAlertEmailText()
Generate email content for security alert operations
private
getSecurityAlertEmailText(string $name, string $alertType) : string
Parameters
- $name : string
-
Recipient name
- $alertType : string
-
Type of alert (email_change or password_change)
Return values
string —Email content
getTeamConfirmedEmailText()
Generate email content for team confirmed notification operations
private
getTeamConfirmedEmailText(string $name, string $eventName, int $teamNumber) : string
Parameters
- $name : string
-
Creator's name
- $eventName : string
-
Event name
- $teamNumber : int
-
Team number
Return values
string —Email content
getTeamInvitationEmailText()
Generate email content for team invitation operations
private
getTeamInvitationEmailText(string $name, string $eventName, string $creatorName, int $teamNumber, int $teamSize, string $validationUrl) : string
Parameters
- $name : string
-
Recipient name
- $eventName : string
-
Event name
- $creatorName : string
-
Team creator name
- $teamNumber : int
-
Team number
- $teamSize : int
-
Team size
- $validationUrl : string
-
Validation URL
Return values
string —Email content
getVerificationEmailText()
Generate email content for email verification operations
private
getVerificationEmailText(string $name, string $verifyUrl) : string
Parameters
- $name : string
-
Recipient name
- $verifyUrl : string
-
Verification URL with token
Return values
string —Email content
smtpConfiguration()
Configure SMTP settings for PHPMailer
private
smtpConfiguration(PHPMailer $mail) : void
Sets up the SMTP connection parameters using AlwaysData server settings.
Parameters
- $mail : PHPMailer
-
PHPMailer instance to configure