From e6c7ccc411100dd62e0cc3aa40c9c1598f013dd6 Mon Sep 17 00:00:00 2001 From: Piotr Potrebka <piotr.potrebka@wpdesk.net> Date: Wed, 1 Feb 2023 12:11:22 +0100 Subject: [PATCH] feat: email abstract --- src/Abstracts/EmailAbstract.php | 6 +++--- src/Mailer.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Abstracts/EmailAbstract.php b/src/Abstracts/EmailAbstract.php index 274c336..6d314b3 100644 --- a/src/Abstracts/EmailAbstract.php +++ b/src/Abstracts/EmailAbstract.php @@ -136,7 +136,7 @@ abstract class EmailAbstract implements EmailInterface { throw new Exception( 'Empty email subject' ); } - return $this->subject; + return $this->replace_placeholders( $this->subject ); } /** @@ -158,7 +158,7 @@ abstract class EmailAbstract implements EmailInterface { * @return string */ public function get_heading(): string { - return $this->heading; + return $this->replace_placeholders( $this->heading ); } /** @@ -285,7 +285,7 @@ abstract class EmailAbstract implements EmailInterface { * @throws Exception */ public function get_content(): string { - return $this->content; + return $this->replace_placeholders( $this->content ); } /** diff --git a/src/Mailer.php b/src/Mailer.php index f8b5e02..6633b52 100644 --- a/src/Mailer.php +++ b/src/Mailer.php @@ -42,7 +42,7 @@ class Mailer { foreach ( $dirs as $dir ) { $resolver->appendResolver( new DirResolver( $dir ) ); } - $resolver->appendResolver( new DirResolver( __DIR__ ) ); + $resolver->appendResolver( new DirResolver( __DIR__ . '/templates' ) ); return new SimplePhpRenderer( $resolver ); } -- GitLab