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

feat: lang

parent 01781dd5
No related branches found
No related tags found
1 merge request!2Devel
Pipeline #153414 passed with stages
in 53 seconds
...@@ -51,13 +51,6 @@ ...@@ -51,13 +51,6 @@
} }
}, },
"autoload-dev": {}, "autoload-dev": {},
"extra": {
"text-domain": "wp-email",
"translations-folder": "lang",
"po-files": {
"pl_PL": "pl_PL.po"
}
},
"scripts": { "scripts": {
"phpcs": "phpcs", "phpcs": "phpcs",
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never", "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
......
...@@ -78,13 +78,21 @@ class Mailer { ...@@ -78,13 +78,21 @@ class Mailer {
add_filter( add_filter(
'wp_mail_from', 'wp_mail_from',
$from_cb = static function () use ( $email ) { $from_cb = static function () use ( $email ) {
return $email->get_from(); if ( ! empty( $email->get_from() ) ) {
return $email->get_from();
}
return 'wordpress@siteurl.pl';
} }
); );
add_filter( add_filter(
'wp_mail_from_name', 'wp_mail_from_name',
$from_name_cb = static function () use ( $email ) { $from_name_cb = static function () use ( $email ) {
return $email->get_from_name(); if ( ! empty( $email->get_from_name() ) ) {
return $email->get_from_name();
}
return 'wordpress';
} }
); );
add_action( 'wp_mail_failed', [ $this, 'catch_error' ] ); add_action( 'wp_mail_failed', [ $this, 'catch_error' ] );
...@@ -138,5 +146,4 @@ class Mailer { ...@@ -138,5 +146,4 @@ class Mailer {
return HTML::style_inline( $content, $styles ); return HTML::style_inline( $content, $styles );
} }
} }
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