-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from railsware/feature/improvements-2023-10
Support 'reply-to' header
- Loading branch information
Showing
7 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,9 @@ $mailtrap = new MailtrapClient(new Config($apiKey)); | |
|
||
$email = (new Email()) | ||
->from(new Address('[email protected]', 'Mailtrap Test')) | ||
->replyTo(new Address('[email protected]')) | ||
->to(new Address('[email protected]', 'Jon')) | ||
->priority(Email::PRIORITY_HIGH) | ||
->cc('[email protected]') | ||
->addCc('[email protected]') | ||
->bcc('[email protected]') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|
||
$email = (new Email()) | ||
->from(new Address('[email protected]', 'Mailtrap Test')) | ||
->replyTo(new Address('[email protected]')) | ||
->to(new Address('[email protected]', 'Jon')) | ||
->cc('[email protected]') | ||
->addCc('[email protected]') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,9 @@ | |
|
||
$email = (new Email()) | ||
->from(new Address('[email protected]', 'Mailtrap Test')) // <--- you should use your domain here that you installed in the mailtrap.io admin area (otherwise you will get 401) | ||
->replyTo(new Address('[email protected]')) | ||
->to(new Address('[email protected]', 'Jon')) | ||
->priority(Email::PRIORITY_HIGH) | ||
->cc('[email protected]') | ||
->addCc('[email protected]') | ||
->bcc('[email protected]') | ||
|
@@ -91,6 +93,7 @@ | |
|
||
$email = (new Email()) | ||
->from(new Address('[email protected]', 'Mailtrap Test')) // <--- you should use your domain here that you installed in the mailtrap.io admin area (otherwise you will get 401) | ||
->replyTo(new Address('[email protected]')) | ||
->to(new Address('[email protected]', 'Jon')) | ||
; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,9 @@ public function testValidSendToSandBox(): void | |
|
||
$email = new Email(); | ||
$email->from(new Address('[email protected]', 'Ms. Foo Bar')) | ||
->replyTo(new Address('[email protected]')) | ||
->to(new Address('[email protected]', 'Mr. Recipient')) | ||
->priority(Email::PRIORITY_HIGH) | ||
->bcc('[email protected]') | ||
->subject('Best practices of building HTML emails') | ||
->text('Some text') | ||
|
@@ -82,7 +84,9 @@ public function testValidSendToSandBox(): void | |
'text' => 'Some text', | ||
'html' => '<p>Some text</p>', | ||
'headers' => [ | ||
'X-Message-Source' => 'dev.mydomain.com' | ||
'X-Message-Source' => 'dev.mydomain.com', | ||
'Reply-To' => '[email protected]', | ||
'X-Priority' => '2 (High)', | ||
] | ||
]) | ||
->willReturn(new Response(200, ['Content-Type' => 'application/json'], json_encode($expectedData))); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,9 @@ public function testValidSend(): void | |
|
||
$email = new Email(); | ||
$email->from(new Address('[email protected]', 'Ms. Foo Bar')) | ||
->replyTo(new Address('[email protected]')) | ||
->to(new Address('[email protected]', 'Mr. Recipient')) | ||
->priority(Email::PRIORITY_HIGH) | ||
->bcc('[email protected]') | ||
->subject('Best practices of building HTML emails') | ||
->text('Some text') | ||
|
@@ -87,7 +89,9 @@ public function testValidSend(): void | |
'text' => 'Some text', | ||
'html' => '<p>Some text</p>', | ||
'headers' => [ | ||
'X-Message-Source' => 'dev.mydomain.com' | ||
'X-Message-Source' => 'dev.mydomain.com', | ||
'Reply-To' => '[email protected]', | ||
'X-Priority' => '2 (High)', | ||
] | ||
]) | ||
->willReturn(new Response(200, ['Content-Type' => 'application/json'], json_encode($expectedData))); | ||
|