Skip to content

Commit

Permalink
refactor: update mail api
Browse files Browse the repository at this point in the history
  • Loading branch information
papac committed Jan 26, 2025
1 parent 308dc47 commit 84dae97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Mail/Adapters/SesAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function send(Envelop $envelop): bool

$email = [
'Destination' => [
'ToAddresses' => $envelop->getTo(),
'ToAddresses' => array_map(fn ($value) => $value[0] !== null ? $value[0] . ' <' . $value[1] . '>' : '<' . $value[1] . '>', $envelop->getTo()),
],
'Source' => $envelop->getFrom(),
'Envelop' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Mail/Envelop.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ private function formatEmail(string $email): array
throw new InvalidArgumentException("$email is not valid email.", E_USER_ERROR);
}

return [$name, $email];
return [is_null($name) ? $email : $name, $email];
}

/**
Expand Down

0 comments on commit 84dae97

Please sign in to comment.