8000 [9.x] Implement Symfony Mailer by driesvints · Pull Request #38481 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[9.x] Implement Symfony Mailer #38481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f1d160f
Implement Symfony Mailer
driesvints Aug 20, 2021
9b70c70
Apply fixes from StyleCI
taylorotwell Aug 20, 2021
f9f8ad3
Update src/Illuminate/Mail/Message.php
driesvints Aug 21, 2021
b821c61
Update src/Illuminate/Mail/Message.php
driesvints Aug 21, 2021
d480103
Update src/Illuminate/Mail/Message.php
driesvints Aug 21, 2021
4abbc80
Update src/Illuminate/Mail/Message.php
driesvints Aug 21, 2021
e157c93
Update src/Illuminate/Mail/Message.php
driesvints Aug 21, 2021
eddfab4
Update Array and Log transports
driesvints Aug 23, 2021
1f68e4b
Apply fixes from StyleCI
taylorotwell Aug 23, 2021
c744477
Fix interface implementation
driesvints Aug 23, 2021
aa88fa1
Update Mailer
driesvints Aug 23, 2021
f6b10e1
Apply fixes from StyleCI
taylorotwell Aug 23, 2021
fa44414
Rename
driesvints Aug 23, 2021
ecea2e6
Remove method
driesvints Aug 23, 2021
9ef4747
Fix tests
driesvints Aug 23, 2021
0d8450e
Apply fixes from StyleCI
taylorotwell Aug 23, 2021
66ad5fa
Work on Mailer tests
driesvints Aug 24, 2021
c0220cd
type-hint
driesvints Aug 24, 2021
2463633
Fix Mailer tests
driesvints Aug 25, 2021
eb33afd
Fix more tests
driesvints Aug 25, 2021
b5aba0e
Apply fixes from StyleCI
taylorotwell Aug 25, 2021
f35a83c
Migrate Mailgun transport
driesvints Aug 27, 2021
58e7343
Migrate Postmark transport
driesvints Aug 27, 2021
17c7889
Replace SesTransport
driesvints Aug 30, 2021
8e87678
Remove transports from dev dependencies
driesvints Aug 30, 2021
3c1d1dc
Allow setting options on esmtp transport
driesvints Sep 2, 2021
66bbe6a
Fix Postmark transport
driesvints Sep 3, 2021
c2c97da
Fix embedding files
driesvints Sep 3, 2021
8724b1f
Clarify API transports
driesvints Sep 3, 2021
d61b7a9
Apply fixes from StyleCI
taylorotwell Sep 7, 2021
eb24e34
Fix SES transport setup
driesvints Sep 8, 2021
d6fc420
Add MessageStreamId to Postmark Transport again (#38748)
Jubeki Sep 10, 2021
c63ade9
Update symfony mailer docblocks (#38773)
Jubeki Sep 12, 2021
4ec09e5
Merge branch 'master' into symfony-mailer
driesvints Sep 13, 2021
78dccf1
Add Session Token to SES Transport (#38797)
Jubeki Sep 13, 2021
5e1baff
Update src/Illuminate/Mail/Transport/ArrayTransport.php
taylorotwell Sep 13, 2021
e23e57e
fix docblock
taylorotwell Sep 13, 2021
c8d1654
Add Wrapper for Symfony SentMessage (#38803)
Jubeki Sep 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add Wrapper for Symfony SentMessage (#38803)
* Create SentMessage wrapper for Symfony's SentMessage

* Wrap Symfony SentMessage

* Update Docblocks to Illuminate\Mail\SentMessage

* Fix sendMailable

* Update SentMessage.php

Co-authored-by: Dries Vints <dries@vints.io>
  • Loading branch information
Jubeki and driesvints authored Sep 14, 2021
commit c8d16545df39de602d61998bdeb9326521e0bd9c
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/Mailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Mailable implements MailableContract, Renderable
* Send the message using the given mailer.
*
* @param \Illuminate\Contracts\Mail\Factory|\Illuminate\Contracts\Mail\Mailer $mailer
* @return \Symfony\Component\Mailer\SentMessage|null
* @return \Illuminate\Mail\SentMessage|null
*/
public function send($mailer)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function bcc($users)
*
* @param string $html
* @param mixed $callback
* @return \Symfony\Component\Mailer\SentMessage|null
* @return \Illuminate\Mail\SentMessage|null
*/
public function html($html, $callback)
{
Expand All @@ -200,7 +200,7 @@ public function html($html, $callback)
*
* @param string $text
* @param mixed $callback
* @return \Symfony\Component\Mailer\SentMessage|null
* @return \Illuminate\Mail\SentMessage|null
*/
public function raw($text, $callback)
{
Expand All @@ -213,7 +213,7 @@ public function raw($text, $callback)
* @param string $view
* @param array $data
* @param mixed $callback
* @return \Symfony\Component\Mailer\SentMessage|null
* @return \Illuminate\Mail\SentMessage|null
*/
public function plain($view, array $data, $callback)
{
Expand Down Expand Up @@ -245,7 +245,7 @@ public function render($view, array $data = [])
* @param \Illuminate\Contracts\Mail\Mailable|string|array $view
* @param array $data
* @param \Closure|string|null $callback
* @return \Symfony\Component\Mailer\SentMessage|null
* @return \Illuminate\Mail\SentMessage|null
*/
public function send($view, array $data = [], $callback = null)
{
Expand Down Expand Up @@ -286,15 +286,15 @@ public function send($view, array $data = [], $callback = null)

$this->dispatchSentEvent($message, $data);

return $sentMessage;
return $sentMessage === null ? null : new SentMessage($sentMessage);
}
}

/**
* Send the given mailable.
*
* @param \Illuminate\Contracts\Mail\Mailable $mailable
* @return mixed
* @return \Illuminate\Mail\SentMessage|null
*/
protected function sendMailable(MailableContract $mailable)
{
Expand Down
54 changes: 54 additions & 0 deletions src/Illuminate/Mail/SentMessage.php
< 8000 td class="blob-code blob-code-addition js-file-line"> }
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace Illuminate\Mail;

use Illuminate\Support\Traits\ForwardsCalls;
use Symfony\Component\Mailer\SentMessage as SymfonySentMessage;

/**
* @mixin \Symfony\Component\Mailer\SentMessage
*/
class SentMessage
{
use ForwardsCalls;

/**
* The Symfony SentMessage instance.
*
* @var \Symfony\Component\Mailer\SentMessage
*/
protected $sentMessage;

/**
* Create a new SentMessage instance.
*
* @param \Symfony\Component\Mailer\SentMessage $sentMessage
* @return void
*/
public function __construct(SymfonySentMessage $sentMessage)
{
$this->sentMessage = $sentMessage;
}

/**
* Get the underlying Symfony Email instance.
*
* @return \Symfony\Component\Mailer\SentMessage
*/
public function getSymfonySentMessage()
{
return $this->sentMessage;
}

/**
* Dynamically pass missing methods to the Symfony instance.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->forwardCallTo($this->sentMessage, $method, $parameters);
}
8 changes: 4 additions & 4 deletions src/Illuminate/Support/Facades/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* @method static \Illuminate\Mail\PendingMail to($users)
* @method static \Illuminate\Support\Collection queued(string $mailable, \Closure|string $callback = null)
* @method static \Illuminate\Support\Collection sent(string $mailable, \Closure|string $callback = null)
* @method static \Symfony\Component\Mailer\SentMessage|null raw(string $text, $callback)
* @method static \Symfony\Component\Mailer\SentMessage|null plain(string $view, array $data, $callback)
* @method static \Symfony\Component\Mailer\SentMessage|null html(string $html, $callback)
* @method static \Symfony\Component\Mailer\SentMessage|null send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null)
* @method static \Illuminate\Mail\SentMessage|null raw(string $text, $callback)
* @method static \Illuminate\Mail\SentMessage|null plain(string $view, array $data, $callback)
* @method static \Illuminate\Mail\SentMessage|null html(string $html, $callback)
* @method static \Illuminate\Mail\SentMessage|null send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null)
* @method static array failures()
* @method static bool hasQueued(string $mailable)
* @method static bool hasSent(string $mailable)
Expand Down
0