Skip to content

Conversation

rosier
Copy link
Contributor

@rosier rosier commented Dec 23, 2019

Changed the type hint to Symfony\Component\Mailer\Transport\TransportInterface instead of Symfony\Component\Mailer\MailerInterface to get Symfony\Component\Mailer\SentMessage from the send method.

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the message Id example

@rosier
Copy link
Contributor Author

rosier commented Dec 23, 2019

I have now changed the type hint instead of removing the message Id example

@rosier rosier requested a review from OskarStark December 28, 2019 14:23
@javiereguiluz
Copy link
Member

@rosier thanks for this contribution!

I personally had issues with this example and I couldn't understand why we didn't show the SentMessage example ... so I added it myself ... but now I understand why I was wrong.

Now I'm divided about this. Using MailerInterface is great, concise and looks beautiful. Using the TransportInterface in the very first mailer example looks ugly in my opinion.

Also, I don't understand why I can't get the SentMessage object with MailerInterface. It looks so obvious and basic to me ... I'm probably missing something here.

@rosier
Copy link
Contributor Author

rosier commented Jan 2, 2020

Using MailerInterface you can also send email async using a message bus. In that case there is no sent message yet.

Maybe it's better to revert this example and add an example using TransportInterface under
https://symfony.com/doc/current/mailer.html#debugging-emails

@HeahDude
Copy link
Contributor

Maybe it's better to revert this example and add an example using TransportInterface under
https://symfony.com/doc/current/mailer.html#debugging-emails

Or maybe we can add a comment about getting a SentMessage only with synch transports.

@rosier
Copy link
Contributor Author

rosier commented Feb 26, 2020

Closing in favor of #13194

@rosier rosier closed this Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment