Sender
in package
Email sending service.
Sends emails with templates using PHPMailer.
Table of Contents
Properties
- $_attachments : array<string|int, mixed>
- $_basePath : string
- $_bcc : array<string|int, mixed>
- $_body : string
- $_cc : array<string|int, mixed>
- $_isHtml : bool
- $_replyTo : string|null
- $_replyToName : string|null
- $_settings : SettingManager|null
- $_subject : string
- $_to : array<string|int, mixed>
Methods
- __construct() : mixed
- attach() : self
- Attach file
- bcc() : self
- Add BCC recipient
- body() : self
- Set body content
- cc() : self
- Add CC recipient
- replyTo() : self
- Set reply-to address
- send() : bool
- Send the email
- subject() : self
- Set subject
- template() : self
- Render email template
- to() : self
- Add recipient
- createMailer() : PHPMailer
- Create and configure PHPMailer instance
- logEmail() : bool
- Log email instead of sending (test mode)
Properties
$_attachments
private
array<string|int, mixed>
$_attachments
= []
$_basePath
private
string
$_basePath
$_bcc
private
array<string|int, mixed>
$_bcc
= []
$_body
private
string
$_body
= ''
$_cc
private
array<string|int, mixed>
$_cc
= []
$_isHtml
private
bool
$_isHtml
= true
$_replyTo
private
string|null
$_replyTo
= null
$_replyToName
private
string|null
$_replyToName
= null
$_settings
private
SettingManager|null
$_settings
$_subject
private
string
$_subject
= ''
$_to
private
array<string|int, mixed>
$_to
= []
Methods
__construct()
public
__construct([SettingManager|null $settings = null ][, string $basePath = '' ]) : mixed
Parameters
- $settings : SettingManager|null = null
- $basePath : string = ''
attach()
Attach file
public
attach(string $filePath[, string $name = '' ]) : self
Parameters
- $filePath : string
- $name : string = ''
Return values
selfbcc()
Add BCC recipient
public
bcc(string $email[, string $name = '' ]) : self
Parameters
- $email : string
- $name : string = ''
Return values
selfbody()
Set body content
public
body(string $body[, bool $isHtml = true ]) : self
Parameters
- $body : string
- $isHtml : bool = true
Return values
selfcc()
Add CC recipient
public
cc(string $email[, string $name = '' ]) : self
Parameters
- $email : string
- $name : string = ''
Return values
selfreplyTo()
Set reply-to address
public
replyTo(string $email[, string $name = '' ]) : self
Parameters
- $email : string
- $name : string = ''
Return values
selfsend()
Send the email
public
send() : bool
Return values
boolsubject()
Set subject
public
subject(string $subject) : self
Parameters
- $subject : string
Return values
selftemplate()
Render email template
public
template(string $templatePath[, array<string|int, mixed> $data = [] ]) : self
Parameters
- $templatePath : string
- $data : array<string|int, mixed> = []
Return values
selfto()
Add recipient
public
to(string $email[, string $name = '' ]) : self
Parameters
- $email : string
- $name : string = ''
Return values
selfcreateMailer()
Create and configure PHPMailer instance
private
createMailer() : PHPMailer
Return values
PHPMailerlogEmail()
Log email instead of sending (test mode)
private
logEmail() : bool