Skip to content
Snippets Groups Projects
Commit 0991e54c authored by Piotr Potrebka's avatar Piotr Potrebka
Browse files

feat: email abstract

parent bd9261da
No related branches found
No related tags found
1 merge request!2Devel
Pipeline #150963 passed with stages
in 55 seconds
...@@ -112,7 +112,7 @@ class EmailSender { ...@@ -112,7 +112,7 @@ class EmailSender {
public function send( array $placeholders = [] ) { public function send( array $placeholders = [] ) {
foreach ( $this->get_emails() as $email ) { foreach ( $this->get_emails() as $email ) {
$content = $this->renderer->render( $email->get_id(), [] ); $content = $this->renderer->render( 'html/' . $email->get_id(), [] );
$content = $this->replace_placeholders( $content, $placeholders ); $content = $this->replace_placeholders( $content, $placeholders );
if ( $email->get_is_enable() ) { if ( $email->get_is_enable() ) {
$this->before_wp_mail(); $this->before_wp_mail();
...@@ -121,7 +121,6 @@ class EmailSender { ...@@ -121,7 +121,6 @@ class EmailSender {
); );
$this->after_wp_mail(); $this->after_wp_mail();
} }
} }
} }
...@@ -141,7 +140,7 @@ class EmailSender { ...@@ -141,7 +140,7 @@ class EmailSender {
* @return mixed|string * @return mixed|string
*/ */
private function get_html_content( string $content ): string { private function get_html_content( string $content ): string {
$styles = $this->renderer->render( 'styles', [] ); $styles = $this->renderer->render( 'html/styles', [] );
return HTMLDecorator::style_inline( $content, $styles ); return HTMLDecorator::style_inline( $content, $styles );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment