Add support for Postmark and SendGrid APIs #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Been asked a couple times why not just use SMTP. I thought it would be worth writing a little more in-depth explanation which should also keep me reminded of the real reasons that pushed me to code this for the current application I am working on.
While SMTP is great and PHP's native email function is super easy to get things started, there are other (and I believe better) solutions. The transports that are introduced in this PR are completely independent of each other and fill a single need in the general 'sending a transactional email' context/process.
Pros I find to using every transport type introduced:
API
DatabaseQueue
Note: the DatabaseQueue'd job can then use the
SmtpTransport
(or anyApiTransport
) to send the email.Any comments/feedback/critic on the above explanation/reasoning or the committed code/implementations below are welcomed (I most probably directly linked you to this page for that exact reason 🎯 ).