Skip to content
Snippets Groups Projects

Devel

Merged Piotr Potrebka requested to merge devel into main
1 file
+ 7
4
Compare changes
  • Side-by-side
  • Inline
+ 7
4
@@ -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' ] );
Loading