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
Commits
ca4eb5a7
Commit
ca4eb5a7
authored
2 years ago
by
Piotr Potrebka
Browse files
Options
Downloads
Patches
Plain Diff
feat: lang
parent
6adcbdb9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2
Devel
Pipeline
#153480
passed
2 years ago
Stage: prepare-vendor
Stage: prepare-node
Stage: tools
Stage: tests
Stage: deploy
Changes
1
Pipelines
1
Show 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 {
...
@@ -14,46 +14,54 @@ abstract class EmailAbstract implements EmailInterface {
/**
/**
* @var array
* @var array
*/
*/
pr
otec
te
d
$recipients
=
[];
pr
iva
te
$recipients
=
[];
/**
/**
* @var array
* @var array
*/
*/
pr
otec
te
d
$placeholders
=
[];
pr
iva
te
$placeholders
=
[];
/**
/**
* @var string
* @var string
*/
*/
pr
otec
te
d
$subject
=
''
;
pr
iva
te
$subject
=
''
;
/**
/**
* @var string
* @var string
*/
*/
pr
otec
te
d
$heading
=
''
;
pr
iva
te
$heading
=
''
;
/**
/**
* @var array
* @var array
*/
*/
pr
otec
te
d
$attachments
=
[];
pr
iva
te
$attachments
=
[];
/**
/**
* @var string
* @var string
*/
*/
pr
otec
te
d
$content
=
''
;
pr
iva
te
$content
=
''
;
/**
/**
* @var string
* @var string
*/
*/
pr
otec
te
d
$type
=
'html'
;
pr
iva
te
$type
=
'html'
;
/**
/**
* @var array
* @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
* @return string
*/
*/
abstract
public
function
get_id
():
string
;
abstract
public
function
get_id
():
string
;
...
@@ -69,14 +77,36 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -69,14 +77,36 @@ abstract class EmailAbstract implements EmailInterface {
* @return string
* @return string
*/
*/
public
function
get_from
():
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
* @return string
*/
*/
public
function
get_from_name
():
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 {
...
@@ -98,8 +128,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Set placeholders.
*
* @param array $placeholders
* @param array $placeholders
*
*
* @return self
* @return self
...
@@ -111,8 +139,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -111,8 +139,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get defined placeholders.
*
* @return string[]
* @return string[]
*/
*/
public
function
get_placeholders
():
array
{
public
function
get_placeholders
():
array
{
...
@@ -120,8 +146,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -120,8 +146,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email subject.
*
* @param string $subject
* @param string $subject
*
*
* @return self
* @return self
...
@@ -133,8 +157,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -133,8 +157,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email subject.
*
* @return string
* @return string
* @throws Exception
* @throws Exception
*/
*/
...
@@ -147,8 +169,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -147,8 +169,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Set email heading.
*
* @param string $heading
* @param string $heading
*
*
* @return self
* @return self
...
@@ -160,8 +180,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -160,8 +180,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email heading.
*
* @return string
* @return string
*/
*/
public
function
get_heading
():
string
{
public
function
get_heading
():
string
{
...
@@ -169,8 +187,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -169,8 +187,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get valid recipients.
*
* @param array $recipients
* @param array $recipients
*
*
* @return self
* @return self
...
@@ -182,8 +198,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -182,8 +198,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get valid recipients.
*
* @return string[]
* @return string[]
*/
*/
public
function
get_recipients
():
array
{
public
function
get_recipients
():
array
{
...
@@ -191,8 +205,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -191,8 +205,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email headers.
*
* @param array $headers
* @param array $headers
*
*
* @return self
* @return self
...
@@ -204,8 +216,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -204,8 +216,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email headers.
*
* @return string[]
* @return string[]
*/
*/
public
function
get_headers
():
array
{
public
function
get_headers
():
array
{
...
@@ -213,8 +223,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -213,8 +223,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Set attachments.
*
* @param array $attachments
* @param array $attachments
*
*
* @return self
* @return self
...
@@ -226,8 +234,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -226,8 +234,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email attachments.
*
* @return array
* @return array
*/
*/
public
function
get_attachments
():
array
{
public
function
get_attachments
():
array
{
...
@@ -235,8 +241,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -235,8 +241,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Set email type.
*
* @param string $type
* @param string $type
*
*
* @return self
* @return self
...
@@ -248,8 +252,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -248,8 +252,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email type.
*
* @return string
* @return string
*/
*/
public
function
get_type
():
string
{
public
function
get_type
():
string
{
...
@@ -257,8 +259,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -257,8 +259,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get content type.
*
* @return string
* @return string
*/
*/
public
function
get_content_type
():
string
{
public
function
get_content_type
():
string
{
...
@@ -273,8 +273,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -273,8 +273,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email content.
*
* @param string $content
* @param string $content
*
*
* @return self
* @return self
...
@@ -286,8 +284,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -286,8 +284,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* Get email content.
*
* @return string
* @return string
* @throws Exception
* @throws Exception
*/
*/
...
@@ -296,8 +292,6 @@ abstract class EmailAbstract implements EmailInterface {
...
@@ -296,8 +292,6 @@ abstract class EmailAbstract implements EmailInterface {
}
}
/**
/**
* @param string $string
*
* @return array|string|string[]
* @return array|string|string[]
*/
*/
protected
function
replace_placeholders
(
string
$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