Skip to content

Commit 670563c

Browse files
committed
exclude transport senders from cleaning contacts
1 parent 33939fd commit 670563c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Mailer.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ public function addContact($email, $name)
119119

120120
public function clearContacts()
121121
{
122-
$this->contacts = array();
122+
$senders = array();
123+
foreach ($this->channels as $transport) {
124+
$email = $transport->getSender();
125+
if (array_key_exists($email, $this->contacts)) {
126+
$senders[$email] = $this->contacts[$email];
127+
}
128+
}
129+
$this->contacts = $senders;
123130
}
124131

125132
/**

0 commit comments

Comments
 (0)