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

feat: email styles

parent 0ef316d0
No related branches found
No related tags found
1 merge request!2Devel
Pipeline #156514 passed with stages
in 1 minute and 7 seconds
...@@ -131,16 +131,19 @@ class Mailer { ...@@ -131,16 +131,19 @@ class Mailer {
continue; continue;
} }
if ( $email->get_is_enable() ) { if ( $email->get_is_enable() ) {
$mailer_from = $this->get_from();
add_filter( add_filter(
'wp_mail_from', 'wp_mail_from',
$from_cb = static function ( $from ) { $from_cb = static function ( $from ) use ( $mailer_from ) {
return $this->get_from(); return $mailer_from;
} }
); );
$mailer_from_name = $this->get_from_name();
add_filter( add_filter(
'wp_mail_from_name', 'wp_mail_from_name',
$from_name_cb = static function ( $from_name ) { $from_name_cb = static function ( $from_name ) use ( $mailer_from_name ) {
return $this->get_from_name(); return $mailer_from_name;
} }
); );
add_action( 'wp_mail_failed', [ $this, 'catch_error' ] ); add_action( 'wp_mail_failed', [ $this, 'catch_error' ] );
......
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