8000 [FrameworkBundle] Move mailer configuration to php by instabledesign · Pull Request #37204 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Move mailer configuration to php #37204

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

instabledesign
Copy link
Contributor
@instabledesign instabledesign commented Jun 11, 2020
Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets Part of #37186
License MIT

Move mailer configuration file to php


->set('mailer.transport_factory.smtp', EsmtpTransportFactory::class)
->parent('mailer.transport_factory.abstract')
->tag('mailer.transport_factory', ['priority' => -100])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should i set string or int value for the priority attribute?

Copy link
Member

Choose a reason for hiding this comment

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

int is fine

->set('mailer.transports', Transports::class)
->factory([service('mailer.transport_factory'), 'fromStrings'])
->args([
[], //transports
Copy link
Contributor

Choose a reason for hiding this comment

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

abstract_arg please as an empty array is not valid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

])

->set('mailer.transport_factory', Transport::class)
->args([tagged_iterator('mailer.transport_factory')])
Copy link
Contributor
@Tobion Tobion Jun 13, 2020

Choose a reason for hiding this comment

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

please use multi-line args consistently everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

])
->tag('data_collector', [
'id' => 'mailer',
'template' => '@WebProfiler/Collector/mailer.html.twig',
Copy link
Contributor

Choose a reason for hiding this comment

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

please change the order of template and id to be consistent with the other data_collector tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@instabledesign
Copy link
Contributor Author

Fixup done
tests failed look unrelated

@Tobion Tobion force-pushed the issue-37186-migrate-mailer-xml-config-to-php-config branch from 3c70354 to eb88f88 Compare June 15, 2020 10:23
@Tobion
Copy link
Contributor
Tobion commented Jun 15, 2020

Thank you @instabledesign.

@Tobion Tobion merged commit b5a2af0 into symfony:master Jun 15, 2020
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 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
0