Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WP Mail
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
Library
WP Mail
Commits
ca4eb5a7
Commit
ca4eb5a7
authored
2 years ago
by
Piotr Potrebka
Browse files
Options
Downloads
Patches
Plain Diff
feat: lang
parent
6adcbdb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Devel
Pipeline
#153480
passed with stages
in 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Abstracts/EmailAbstract.php
+42
-48
42 additions, 48 deletions
src/Abstracts/EmailAbstract.php
with
42 additions
and
48 deletions
src/Abstracts/EmailAbstract.php
+
42
−
48
View file @
ca4eb5a7
...
...
@@ -14,46 +14,54 @@ abstract class EmailAbstract implements EmailInterface {
/**
* @var array
*/
pr
otec
te
d
$recipients
=
[];
pr
iva
te
$recipients
=
[];
/**
* @var array
*/
pr
otec
te
d
$placeholders
=
[];
pr
iva
te
$placeholders
=
[];
/**
* @var string
*/
pr
otec
te
d
$subject
=
''
;
pr
iva
te
$subject
=
''
;
/**
* @var string
*/
pr
otec
te
d
$heading
=
''
;
pr
iva
te
$heading
=
''
;
/**
* @var array
*/
pr
otec
te
d
$attachments
=
[];
pr
iva
te
$attachments
=
[];
/**
* @var string
*/
pr
otec
te
d
$content
=
''
;
pr
iva
te
$content
=
''
;
/**
* @var string
*/
pr
otec
te
d
$type
=
'html'
;
pr
iva
te
$type
=
'html'
;
/**
* @var array
*/
protected
$headers
=
[];
private
$headers
=
[
'Content-Type: text/html; charset=UTF-8'
];
/**
* @var string
*/
private
$from_email
;
/**
* @var string
*/
private
$from_name
;
/**
* Define unique email ID.
*
* @return string
*/
abstract
public
function
get_id
():
string
;
...
...
@@ -69,14 +77,36 @@ abstract class EmailAbstract implements EmailInterface {
* @return string
*/
public
function
get_from
():
string
{
return
''
;
return
sanitize_email
(
$this
->
from_email
);
}
/**
* @param string $from_email
*
* @return self
*/
public
function
set_from
(
string
$from_email
):
self
{
$this
->
from_email
=
$from_email
;
return
$this
;
}
/**
* @param string $from_name
*
* @return self
*/
public
function
set_from_name
(
string
$from_name
):
self
{
$this
->
from_name
=
$from_name
;
return
$this
;
}
/**
* @return string
*/
public
function
get_from_name
():
string
{
return
''
;
return
wp_specialchars_decode
(
esc_html
(
$this
->
from_name
),
ENT_QUOTES
)
;
}
/**
...
...
@@ -98,8 +128,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Set placeholders.
*
* @param array $placeholders
*
* @return self
...
...
@@ -111,8 +139,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get defined placeholders.
*
* @return string[]
*/
public
function
get_placeholders
():
array
{
...
...
@@ -120,8 +146,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email subject.
*
* @param string $subject
*
* @return self
...
...
@@ -133,8 +157,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email subject.
*
* @return string
* @throws Exception
*/
...
...
@@ -147,8 +169,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Set email heading.
*
* @param string $heading
*
* @return self
...
...
@@ -160,8 +180,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email heading.
*
* @return string
*/
public
function
get_heading
():
string
{
...
...
@@ -169,8 +187,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get valid recipients.
*
* @param array $recipients
*
* @return self
...
...
@@ -182,8 +198,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get valid recipients.
*
* @return string[]
*/
public
function
get_recipients
():
array
{
...
...
@@ -191,8 +205,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email headers.
*
* @param array $headers
*
* @return self
...
...
@@ -204,8 +216,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email headers.
*
* @return string[]
*/
public
function
get_headers
():
array
{
...
...
@@ -213,8 +223,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Set attachments.
*
* @param array $attachments
*
* @return self
...
...
@@ -226,8 +234,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email attachments.
*
* @return array
*/
public
function
get_attachments
():
array
{
...
...
@@ -235,8 +241,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Set email type.
*
* @param string $type
*
* @return self
...
...
@@ -248,8 +252,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email type.
*
* @return string
*/
public
function
get_type
():
string
{
...
...
@@ -257,8 +259,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get content type.
*
* @return string
*/
public
function
get_content_type
():
string
{
...
...
@@ -273,8 +273,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email content.
*
* @param string $content
*
* @return self
...
...
@@ -286,8 +284,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* Get email content.
*
* @return string
* @throws Exception
*/
...
...
@@ -296,8 +292,6 @@ abstract class EmailAbstract implements EmailInterface {
}
/**
* @param string $string
*
* @return array|string|string[]
*/
protected
function
replace_placeholders
(
string
$string
):
string
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment