Allow reply-to with only address

[MAILPOET-3812]
This commit is contained in:
Brezo Cordero
2021-09-29 12:36:03 -05:00
committed by Veljko V
parent da5e590428
commit 7f7903e55c
2 changed files with 22 additions and 2 deletions

View File

@@ -75,6 +75,24 @@ class MailPoetAPITest extends \MailPoetTest {
expect($body[0]['text'])->equals($this->newsletter['body']['text']);
}
public function testItRemovesReplyToNameIfEmpty() {
$replyTo = [
'reply_to_email' => 'reply-to@mailpoet.com',
'reply_to_name_email' => '<reply-to@mailpoet.com>',
];
$mailer = new MailPoet(
$this->settings['api_key'],
$this->sender,
$replyTo,
new MailPoetMapper(),
$this->makeEmpty(AuthorizedEmailsController::class)
);
$body = $mailer->getBody($this->newsletter, $this->subscriber);
expect($body[0]['reply_to'])->equals([
'address' => 'reply-to@mailpoet.com',
]);
}
public function testItCanGenerateBodyForMultipleMessages() {
$newsletters = array_fill(0, 10, $this->newsletter);
$subscribers = array_fill(0, 10, $this->subscriber);