Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
Fix add address by type with new array key and array recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
Mischa Braam committed Aug 31, 2020
1 parent 13887fb commit 4adfa3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Mail/Template/TransportBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,14 @@ private function addAddressByType(string $addressType, $email, ?string $name = n
{
if (is_string($email)) {
$this->messageData[$addressType][] = $this->addressConverter->convert($email, $name);

return;
}

$convertedAddressArray = $this->addressConverter->convertMany($email);
if (isset($this->messageData[$addressType])) {
$this->messageData[$addressType] = array_merge(
$this->messageData[$addressType],
$convertedAddressArray
);
}
$this->messageData[$addressType] = array_merge($this->messageData[$addressType] ?? [], $convertedAddressArray);

return $this;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
"name": "weprovide/magento2-module-mailattachment",
"description": "Extends TransportBuilder with attachment functionality",
"type": "magento2-module",
"version": "2.1.2",
"authors": [
{
"email": "[email protected]",
"name": "Sander Hartman"
},
{
"email": "[email protected]",
"name": "Mischa Braam"
}
],
"license": "MIT",
Expand Down

0 comments on commit 4adfa3c

Please sign in to comment.