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

feat: email abstract

parent 539e0cfb
No related branches found
No related tags found
1 merge request!2Devel
Pipeline #153110 passed
...@@ -58,6 +58,9 @@ abstract class EmailAbstract implements EmailInterface { ...@@ -58,6 +58,9 @@ abstract class EmailAbstract implements EmailInterface {
*/ */
abstract public function get_id(): string; abstract public function get_id(): string;
/**
* @return string
*/
public function get_template_name(): string { public function get_template_name(): string {
return 'default'; return 'default';
} }
...@@ -298,6 +301,10 @@ abstract class EmailAbstract implements EmailInterface { ...@@ -298,6 +301,10 @@ abstract class EmailAbstract implements EmailInterface {
* @return array|string|string[] * @return array|string|string[]
*/ */
protected function replace_placeholders( string $string ): string { protected function replace_placeholders( string $string ): string {
if ( empty( $this->placeholders ) ) {
return $string;
}
return (string) str_replace( array_keys( $this->placeholders ), array_values( $this->placeholders ), $string ); return (string) str_replace( array_keys( $this->placeholders ), array_values( $this->placeholders ), $string );
} }
......
...@@ -11,6 +11,13 @@ interface EmailInterface { ...@@ -11,6 +11,13 @@ interface EmailInterface {
*/ */
public function get_id(): string; public function get_id(): string;
/**
* Get template name.
*
* @return string
*/
public function get_template_name(): string;
/** /**
* @return string * @return string
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment