Skip to content

[Mailer] Added Sendinblue bridge #38277

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 1 commit into from
Sep 24, 2020
Merged

Conversation

drixs6o9
Copy link
Contributor

@drixs6o9 drixs6o9 commented Sep 23, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR symfony/symfony-docs#14272
Recipe symfony/recipes#822

N.B. I had a little help from Pierre TONDEREAU for the API.

@drixs6o9 drixs6o9 changed the title [Mailer] Added Sendinblue bridge [WIP][Mailer] Added Sendinblue bridge Sep 23, 2020
@nicolas-grekas nicolas-grekas added this to the next milestone Sep 23, 2020
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

You also need to register the transport in src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_transports.xml, and add it to src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php, src/Symfony/Component/Mailer/Exception/UnsupportedSchemeException.php, and src/Symfony/Component/Mailer/Transport.php as well.

CHANGELOG
=========

5.3.0
Copy link
Member

Choose a reason for hiding this comment

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

Could be 5.2 as I think we can add it in 5.2 in time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed this also for symfony-docs and recipe.

],
"require": {
"php": ">=7.2.5",
"symfony/mailer": "^4.4|^5.0"
Copy link
Member

Choose a reason for hiding this comment

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

Should be ^5.1 (as you are using MetadataHeader which is not part of earlier versions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

self::SENDINBLUE_TLS_ENABLED,
$dispatcher,
$logger
);
Copy link
Member

Choose a reason for hiding this comment

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

Can be on one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

/**
* @author Yann LUCAS
*/
final class SendinblueSmtpsTransport extends EsmtpTransport
Copy link
Member

Choose a reason for hiding this comment

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

This class should not be needed. The EsmtpTransport is able to determine the port 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.

I have removed this class.

$this->getPassword($dsn),
$this->dispatcher,
$this->logger
);
Copy link
Member

Choose a reason for hiding this comment

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

should be on one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@drixs6o9 drixs6o9 changed the title [WIP][Mailer] Added Sendinblue bridge [Mailer] Added Sendinblue bridge Sep 24, 2020
*/
final class SendinblueSmtpTransport extends EsmtpTransport
{
const SENDINBLUE_SMTP_HOST = 'smtp-relay.sendinblue.com';
Copy link
Member

Choose a reason for hiding this comment

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

These 3 consts can be inlined IMHO or at least be marked private.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes i changed for inline values. There is no other usages for those constants.

@fabpot
Copy link
Member

fabpot commented Sep 24, 2020

Thank you @drixs6o9.

@fabpot fabpot merged commit 5c48235 into symfony:master Sep 24, 2020
@drixs6o9
Copy link
Contributor Author

Thank you @drixs6o9.

Thank you too. And also @nicolas-grekas and @noniagriconomie

@noniagriconomie
Copy link
Contributor

@drixs6o9 👍 i saw that this provider do also have an SMS endpoint

maybe it could be added (if PR can be reviewed/merged like this one) :)

@drixs6o9
Copy link
Contributor Author

@drixs6o9 i saw that this provider do also have an SMS endpoint

maybe it could be added (if PR can be reviewed/merged like this one) :)

Yes, it's a good idea. I'll see this soon.

@drixs6o9 drixs6o9 deleted the sendinblue-mailer branch September 24, 2020 14:37
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
@fabpot fabpot mentioned this pull request Oct 5, 2020
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