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
b9bf52cb
Commit
b9bf52cb
authored
2 years ago
by
Piotr Potrebka
Browse files
Options
Downloads
Patches
Plain Diff
feat: email abstract
parent
87263a6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Devel
Pipeline
#151260
passed with stages
in 56 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/EmailSender.php
+3
-2
3 additions, 2 deletions
src/EmailSender.php
src/tempates/html/email-footer.php
+1
-1
1 addition, 1 deletion
src/tempates/html/email-footer.php
src/tempates/html/email-header.php
+44
-42
44 additions, 42 deletions
src/tempates/html/email-header.php
with
48 additions
and
45 deletions
src/EmailSender.php
+
3
−
2
View file @
b9bf52cb
...
...
@@ -125,7 +125,7 @@ class EmailSender {
public
function
get_template
(
EmailInterface
$email
,
$placeholders
=
[]
):
string
{
$content
=
$this
->
replace_placeholders
(
$email
->
get_content
(),
$placeholders
);
$output
=
$this
->
renderer
->
render
(
'html/email-header'
,
[]
);
$output
=
$this
->
renderer
->
render
(
'html/email-header'
,
[
'heading'
=>
$email
->
get_heading
(),
'logo'
=>
''
]
);
$output
.
=
$this
->
renderer
->
render
(
'html/'
.
$email
->
get_id
(),
[
'content'
=>
$content
]
);
$output
.
=
$this
->
renderer
->
render
(
'html/email-footer'
,
[]
);
...
...
@@ -149,7 +149,8 @@ class EmailSender {
*/
private
function
css_inline
(
string
$content
):
string
{
$styles
=
$this
->
renderer
->
render
(
'html/email-styles'
,
[]
);
$body
=
HTMLDecorator
::
style_inline
(
$content
,
$styles
);
return
HTMLDecorator
::
style_inline
(
$content
,
$styles
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/tempates/html/email-footer.php
+
1
−
1
View file @
b9bf52cb
...
...
@@ -40,7 +40,7 @@ defined( 'ABSPATH' ) || exit;
<table
border=
"0"
cellpadding=
"10"
cellspacing=
"0"
width=
"100%"
>
<tr>
<td
colspan=
"2"
valign=
"middle"
id=
"credit"
>
<?php
echo
wp_kses_post
(
wpautop
(
wptexturize
(
apply_filters
(
'w
oocommerce_email_footer_text'
,
get_option
(
'woocommerce_email_footer_text'
)
)
)
)
);
?>
<?php
echo
wp_kses_post
(
wpautop
(
wptexturize
(
apply_filters
(
'w
pdesk/wp_mail/template/footer'
,
''
)
)
)
);
?>
</td>
</tr>
</table>
...
...
This diff is collapsed.
Click to expand it.
src/tempates/html/email-header.php
+
44
−
42
View file @
b9bf52cb
...
...
@@ -16,50 +16,52 @@
*/
if
(
!
defined
(
'ABSPATH'
)
)
{
exit
;
// Exit if accessed directly
exit
;
// Exit if accessed directly
}
$params
=
isset
(
$params
)
?
$params
:
[];
?>
<!DOCTYPE html>
<html
<?php
language_attributes
();
?>
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=
<?php
bloginfo
(
'charset'
);
?>
"
/>
<title>
<?php
echo
get_bloginfo
(
'name'
,
'display'
);
?>
</title>
</head>
<body
<?php
echo
is_rtl
()
?
'rightmargin'
:
'leftmargin'
;
?>
="0"
marginwidth=
"0"
topmargin=
"0"
marginheight=
"0"
offset=
"0"
>
<div
id=
"wrapper"
dir=
"
<?php
echo
is_rtl
()
?
'rtl'
:
'ltr'
;
?>
"
>
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
height=
"100%"
width=
"100%"
>
<tr>
<td
align=
"center"
valign=
"top"
>
<div
id=
"template_header_image"
>
<?php
if
(
$img
=
get_option
(
'woocommerce_email_header_image'
)
)
{
echo
'<p style="margin-top:0;"><img src="'
.
esc_url
(
$
img
)
.
'" alt="'
.
get_bloginfo
(
'name'
,
'display'
)
.
'" /></p>'
;
}
?>
</div>
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"600"
id=
"template_container"
>
<tr>
<td
align=
"center"
valign=
"top"
>
<!-- Header -->
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"100%"
id=
"template_header"
>
<tr>
<td
id=
"header_wrapper"
>
<h1>
<?php
echo
$
email_
heading
;
?>
</h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<tr>
<td
align=
"center"
valign=
"top"
>
<!-- Body -->
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"600"
id=
"template_body"
>
<tr>
<td
valign=
"top"
id=
"body_content"
>
<!-- Content -->
<table
border=
"0"
cellpadding=
"20"
cellspacing=
"0"
width=
"100%"
>
<tr>
<td
valign=
"top"
>
<div
id=
"body_content_inner"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=
<?php
bloginfo
(
'charset'
);
?>
"
/>
<title>
<?php
echo
get_bloginfo
(
'name'
,
'display'
);
?>
</title>
</head>
<body
<?php
echo
is_rtl
()
?
'rightmargin'
:
'leftmargin'
;
?>
="0"
marginwidth=
"0"
topmargin=
"0"
marginheight=
"0"
offset=
"0"
>
<div
id=
"wrapper"
dir=
"
<?php
echo
is_rtl
()
?
'rtl'
:
'ltr'
;
?>
"
>
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
height=
"100%"
width=
"100%"
>
<tr>
<td
align=
"center"
valign=
"top"
>
<div
id=
"template_header_image"
>
<?php
if
(
$params
[
'logo'
]
)
{
echo
'<p style="margin-top:0;"><img src="'
.
esc_url
(
$
params
[
'logo'
]
)
.
'" alt="'
.
get_bloginfo
(
'name'
,
'display'
)
.
'" /></p>'
;
}
?>
</div>
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"600"
id=
"template_container"
>
<tr>
<td
align=
"center"
valign=
"top"
>
<!-- Header -->
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"100%"
id=
"template_header"
>
<tr>
<td
id=
"header_wrapper"
>
<h1>
<?php
echo
$
params
[
'
heading
'
]
;
?>
</h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<tr>
<td
align=
"center"
valign=
"top"
>
<!-- Body -->
<table
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"600"
id=
"template_body"
>
<tr>
<td
valign=
"top"
id=
"body_content"
>
<!-- Content -->
<table
border=
"0"
cellpadding=
"20"
cellspacing=
"0"
width=
"100%"
>
<tr>
<td
valign=
"top"
>
<div
id=
"body_content_inner"
>
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