Skip to content

Commit

Permalink
FIX Handle when fallback email address is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Feb 5, 2025
1 parent cd7b692 commit 27eb959
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Extensions/ContentReviewDefaultSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,14 @@ public function getReviewFrom()
if ($from) {
return $from;
}

// Fall back to admin email
return Config::inst()->get(Email::class, 'admin_email');
$adminEmail = Config::inst()->get(Email::class, 'admin_email');
if (is_array($adminEmail)) {
// May be configured using an array ['admin-email@mysite.text' => 'Admin email label']
// https://docs.silverstripe.org/en/developer_guides/email/#administrator-emails
return array_values(array_keys($adminEmail))[0];
}
return $adminEmail;
}

/**
Expand Down

0 comments on commit 27eb959

Please sign in to comment.