Use admin_email as default sender.

[MAILPOET-5498]
This commit is contained in:
Brezo Cordero
2023-07-31 20:00:32 -05:00
committed by Aschepikov
parent d7e283dea9
commit ee882b99e9

View File

@ -231,9 +231,11 @@ class Populator {
// parse current user name if an email is used
$senderName = explode('@', $currentUserName);
$senderName = reset($senderName);
// If current user is not set, default to admin email
$senderAddress = $currentUser->user_email ?: $this->wp->getOption('admin_email'); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$defaultSender = [
'name' => $senderName,
'address' => $currentUser->user_email ?: '', // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
'address' => $senderAddress ?: '',
];
$savedSender = $this->settings->fetch('sender', []);