Skip to content

[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

Closed
wants to merge 13 commits into from
Closed

[Mailer] Added OhMySMTP Bridge #42710

wants to merge 13 commits into from

Conversation

paul-oms
Copy link
Contributor

@paul-oms paul-oms commented Aug 24, 2021

This adds the https://ohmysmtp.com bridge to enable sending over the OhMySMTP API.

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets none
License MIT
Doc PR symfony/symfony-docs#15747...

This commit adds the https://ohmysmtp.com bridge to enable sending over the OhMySMTP API.
@carsonbot
Copy link

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:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.4 branch.

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!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

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

@paul-oms
Copy link
Contributor Author

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!

@derrabus
Copy link
Member

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.

You don't need to fix tests you didn't break. 😃

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.

Thanks for providing a new bridge, this is much appreciated 👍🏻

I left some comments

{
$response = $this->client->request('POST', 'https://'.$this->getEndpoint().'/send', [
'headers' => [
'Accept' => 'application/json',
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

I double checked and only Content-Type can be removed, Accept is needed if needed by the API

image

'headers' => [
'Accept' => 'application/json',
'OhMySMTP-Server-Token' => $this->key,
'Content-Type' => 'application/json',
Copy link
Contributor

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

Copy link
Contributor Author

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?

@paul-oms
Copy link
Contributor Author

@OskarStark regarding the class names, it seems Fabbot is enforcing lowercase e.g. OhmysmtpTransportFactory over OhMySmtpTransportFactory

Which way should it be?

@OskarStark
Copy link
Contributor

To me it should be the second one

cc @fabpot

@OskarStark
Copy link
Contributor

Maybe it is because the folder is named lowercase?

@paul-oms
Copy link
Contributor Author

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!

@fabpot
Copy link
Member

fabpot commented Aug 26, 2021

@OskarStark regarding the class names, it seems Fabbot is enforcing lowercase e.g. OhmysmtpTransportFactory over OhMySmtpTransportFactory

Which way should it be?

OhMySmtpTransportFactory is the one to use to be consistent with the Symfony class naming convention.

@paul-oms
Copy link
Contributor Author

Thanks @fabpot and @OskarStark for the review. All requested changes have been completed.

@OskarStark
Copy link
Contributor

After my comments we are good to go

@fabpot
Copy link
Member

fabpot commented Aug 26, 2021

Thank you @paul-oms.

fabpot added a commit that referenced this pull request Aug 26, 2021
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
@fabpot fabpot closed this Aug 26, 2021
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Aug 30, 2021
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 was referenced Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants