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 with stages
in 53 seconds
......@@ -58,6 +58,9 @@ abstract class EmailAbstract implements EmailInterface {
*/
abstract public function get_id(): string;
/**
* @return string
*/
public function get_template_name(): string {
return 'default';
}
......@@ -298,6 +301,10 @@ abstract class EmailAbstract implements EmailInterface {
* @return array|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 );
}
......
......@@ -11,6 +11,13 @@ interface EmailInterface {
*/
public function get_id(): string;
/**
* Get template name.
*
* @return string
*/
public function get_template_name(): string;
/**
* @return string
*/
......
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