-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Added OhMySMTP Bridge #42710
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
Conversation
This commit adds the https://ohmysmtp.com bridge to enable sending over the OhMySMTP API.
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you. Cheers! Carsonbot |
Hi Core team - from what I can tell the failing tests are all failing on the 5.4 branch as well as here. So I assume I don't need to try to fix any more of these. Let me know if that's not correct. Would love to get this into the 5.4 release, thanks! |
You don't need to fix tests you didn't break. 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for providing a new bridge, this is much appreciated 👍🏻
I left some comments
src/Symfony/Component/Mailer/Bridge/Ohmysmtp/Tests/Transport/OhmysmtpApiTransportTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Ohmysmtp/Tests/Transport/OhmysmtpTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
{ | ||
$response = $this->client->request('POST', 'https://'.$this->getEndpoint().'/send', [ | ||
'headers' => [ | ||
'Accept' => 'application/json', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed, as you are using the json key below, which send the header automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @OskarStark I tested this end to end and the content-type and accept headers were not set on the outbound request, so the OhMySMTP API rejected the request - so I think we do need to leave this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @nicolas-grekas am I missing sth? It should set the headers, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'headers' => [ | ||
'Accept' => 'application/json', | ||
'OhMySMTP-Server-Token' => $this->key, | ||
'Content-Type' => 'application/json', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed, as you are using the json key below, which send the header automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @OskarStark I tested this end to end and the content-type and accept headers were not set on the outbound request, so the OhMySMTP API rejected the request - so I think we do need to leave this in?
src/Symfony/Component/Mailer/Bridge/Ohmysmtp/Transport/OhmysmtpSmtpTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Ohmysmtp/Transport/OhmysmtpTransportFactory.php
Outdated
Show resolved
Hide resolved
@OskarStark regarding the class names, it seems Fabbot is enforcing lowercase e.g. OhmysmtpTransportFactory over OhMySmtpTransportFactory Which way should it be? |
To me it should be the second one cc @fabpot |
Maybe it is because the folder is named lowercase? |
You were right, took me a bit of wrestling with git to get it right but it's there now. Thanks! |
src/Symfony/Component/Mailer/Bridge/OhMySmtp/Tests/Transport/OhMySmtpApiTransportTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/OhMySmtp/Tests/Transport/OhMySmtpSmtpTransportTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/OhMySmtp/Tests/Transport/OhMySmtpTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/OhMySmtp/Transport/OhMySmtpApiTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/OhMySmtp/Transport/OhMySmtpSmtpTransport.php
Outdated
Show resolved
Hide resolved
|
src/Symfony/Component/Mailer/Exception/UnsupportedSchemeException.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Tests/Exception/UnsupportedSchemeExceptionTest.php
Outdated
Show resolved
Hide resolved
…o oh-my-smtp-mailer,
Thanks @fabpot and @OskarStark for the review. All requested changes have been completed. |
src/Symfony/Component/Mailer/Bridge/OhMySmtp/Tests/Transport/OhMySmtpApiTransportTest.php
Outdated
Show resolved
Hide resolved
After my comments we are good to go |
Thank you @paul-oms. |
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Mailer] Added OhMySMTP Bridge This adds the https://ohmysmtp.com bridge to enable sending over the [OhMySMTP](https://ohmysmtp.com) API. | Q | A | ------------- | --- | Branch? | 5.4 <!-- see below --> | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | none <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#15747... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch 5.x. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry --> Commits ------- ce72fd8 [Mailer] Added OhMySMTP Bridge
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Mailer] Added OhMySMTP mailer details Refs symfony/symfony#42710 Commits ------- b3dc6a8 [Mailer] Added OhMySMTP mailer details
This adds the https://ohmysmtp.com bridge to enable sending over the OhMySMTP API.