Skip to content

Commit

Permalink
Merge pull request #272 from creative-commoners/pulls/5/fix-fallback-…
Browse files Browse the repository at this point in the history
…email

FIX Handle when fallback email address is an array
  • Loading branch information
GuySartorelli authored Feb 20, 2025
2 parents cd7b692 + 27eb959 commit ce8adf2
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 ce8adf2

Please sign in to comment.