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
bf1b3c6f
Commit
bf1b3c6f
authored
9 months ago
by
Piotr Potrebka
Browse files
Options
Downloads
Patches
Plain Diff
feat: email styles
parent
44881e2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!3
feat: email styles
,
!2
Devel
Pipeline
#400621
passed with warnings with stages
in 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Template.php
+2
-2
2 additions, 2 deletions
src/Template.php
src/WPMailer.php
+2
-3
2 additions, 3 deletions
src/WPMailer.php
with
4 additions
and
5 deletions
src/
Email
Template.php
→
src/Template.php
+
2
−
2
View file @
bf1b3c6f
...
...
@@ -5,7 +5,7 @@ namespace WPDesk\Library\WPEmail;
use
WPDesk\Library\WPEmail\Helpers\StyleInliner
;
use
WPDesk\View\Renderer\Renderer
;
class
Email
Template
{
class
Template
{
/**
* @var Renderer
...
...
@@ -22,7 +22,7 @@ class EmailTemplate {
$this
->
template_attributes
=
wp_parse_args
(
$template_attributes
,
$this
->
get_default_template_attributes
()
);
}
public
function
get_
email_template
(
string
$content
):
string
{
public
function
get_
body
(
string
$content
):
string
{
$output
=
$this
->
renderer
->
render
(
'html/email-header'
,
$this
->
template_attributes
);
$output
.
=
$this
->
renderer
->
render
(
'html/email-content'
,
[
'content'
=>
$content
]
);
$output
.
=
$this
->
renderer
->
render
(
'html/email-footer'
,
[
'footer'
=>
$this
->
template_attributes
[
'footer'
]
]
);
...
...
This diff is collapsed.
Click to expand it.
src/WPMailer.php
+
2
−
3
View file @
bf1b3c6f
...
...
@@ -12,7 +12,6 @@ use WPDesk\View\Renderer\SimplePhpRenderer;
use
WPDesk\View\Resolver\ChainResolver
;
use
WPDesk\View\Resolver\DirResolver
;
class
WPMailer
implements
Mailer
{
/**
...
...
@@ -54,13 +53,13 @@ class WPMailer implements Mailer {
);
add_action
(
'wp_mail_failed'
,
[
$this
,
'catch_error'
]
);
$email_template
=
new
Email
Template
(
$this
->
renderer
,
$email
->
get_template_attributes
()
);
$email_template
=
new
Template
(
$this
->
renderer
,
$email
->
get_template_attributes
()
);
try
{
$success
=
wp_mail
(
$email
->
get_recipients
(),
$email
->
get_subject
(),
$email_template
->
get_
email_template
(
$email
->
get_content
()
),
$email_template
->
get_
body
(
$email
->
get_content
()
),
$email
->
get_headers
(),
$email
->
get_attachments
()
);
...
...
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