Skip to content

Commit

Permalink
feat: allow passing Address to Replyable email lists
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbrs committed May 16, 2023
1 parent 1ddcb7d commit adb52ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You need to create an application in the [Google Console](https://console.develo

Add cerbaro/laravel-gmail to composer.json.

`"cerbaro/laravel-gmail": "^1.0"`
`"cerbaro/laravel-gmail": "^1.1"`

Run composer update to pull down the latest version.

Expand Down
4 changes: 3 additions & 1 deletion src/Traits/Replyable.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ private function convertEmailList($emails, $name = null)
$newList = [];
$count = 0;
foreach ($emails as $key => $email) {
if (str_contains($key, '@')) {
if ($email instanceof Address) {
$newList[$email->getAddress()] = $email->getName();
} else if (str_contains($key, '@')) {
$newList[$key] = $email;
} else {
$emailName = isset($name[$count]) ? $name[$count] : (isset($name[$key]) ? $name[$key] : explode('@', $email)[0]);
Expand Down

0 comments on commit adb52ee

Please sign in to comment.