Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WP Mail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
Library
WP Mail
Merge requests
!5
Devel
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Devel
devel
into
main
Overview
0
Commits
6
Pipelines
1
Changes
5
Merged
Piotr Potrebka
requested to merge
devel
into
main
8 months ago
Overview
0
Commits
6
Pipelines
1
Changes
5
0
0
Merge request reports
Viewing commit
4932c63b
Prev
Next
Show latest version
5 files
+
33
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
4932c63b
feat: refactor
· 4932c63b
Piotr Potrebka
authored
8 months ago
src/Abstracts/Email.php
+
23
−
13
View file @ 4932c63b
Edit in single-file editor
Open in Web IDE
Show full file
@@ -9,42 +9,42 @@ class Email {
/**
* @var array
*/
private
$recipients
=
[];
private
array
$recipients
=
[];
/**
* @var string
*/
private
$subject
=
''
;
private
string
$subject
=
''
;
/**
* @var array
*/
private
$attachments
=
[];
private
array
$attachments
=
[];
/**
* @var string
*/
private
$content
=
''
;
private
string
$content
=
''
;
/**
* @var array
*/
private
$headers
=
[
'Content-Type'
=>
'text/html'
];
private
array
$headers
=
[
'Content-Type'
=>
'text/html'
];
/**
* @var string
*/
private
$from_email
;
private
string
$from_email
;
/**
* @var string
*/
private
$from_name
;
private
string
$from_name
;
/**
* @var array
*/
private
$template_attributes
;
private
array
$template_attributes
;
/**
* @param string $from_email
@@ -106,7 +106,7 @@ class Email {
*
* @return self
*/
public
function
set_recipients
(
array
$recipients
=
[]
):
self
{
public
function
set_recipients
(
array
$recipients
):
self
{
$this
->
recipients
=
$recipients
;
return
$this
;
@@ -162,9 +162,11 @@ class Email {
}
/**
* @return string
* @param $type
*
* @return Email
*/
public
function
set_content_type
(
$type
=
'html'
):
self
{
public
function
set_content_type
(
$type
):
self
{
switch
(
$type
)
{
case
'plain'
:
$content_type
=
'text/plain'
;
@@ -200,12 +202,20 @@ class Email {
return
$this
->
content
;
}
public
function
set_template_attributes
(
string
$name
,
string
$value
):
self
{
$this
->
template_attributes
[
$name
]
=
$value
;
/**
* @param array $template_attributes
*
* @return $this
*/
public
function
set_template_attributes
(
array
$template_attributes
):
self
{
$this
->
template_attributes
=
$template_attributes
;
return
$this
;
}
/**
* @return array
*/
public
function
get_template_attributes
():
array
{
return
$this
->
template_attributes
;
}
Loading