Skip to content

Commit

Permalink
support email arrays as in ss4/5
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Feb 5, 2024
1 parent 6e0d846 commit 78080dc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/SparkPostHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,13 @@ public static function resolveDefaultFromEmail($from = null, $createDefault = tr
return $configEmail;
}
// Use admin email if set
if ($admin = Email::config()->admin_email) {
return $admin;
if ($adminEmail = Email::config()->admin_email) {
if (is_array($adminEmail) && count($adminEmail ?? []) > 0) {
$email = array_keys($adminEmail)[0];
return [$email => $adminEmail[$email]];
} elseif (is_string($adminEmail)) {
return $adminEmail;
}
}
// If we still don't have anything, create something based on the domain
if ($createDefault) {
Expand Down

0 comments on commit 78080dc

Please sign in to comment.