Skip to content
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

Add symfony mailer integration #274

Merged

Conversation

bramtervoort
Copy link
Contributor

@bramtervoort bramtervoort commented Jan 7, 2021

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs #issuenum
License MIT

What's in this PR?

Created a mailer helper class to send emails using the new sf mailer
component. Created a configuration option to switch to varying mail
helpers.

Why?

It would be nice to be able to use the new Symfony Mailer component for sending the emails.

Example Usage

In the configuration just state:

sulu_form:
    mail:
        helper: "mailer"

Note that the user can now create customer helpers to and wire them in using a tag and this configuration setting.

To Do

  • Create documentation for the new tag i added if that is needed in you opinion.

@niklasnatter niklasnatter changed the base branch from master to 2.x January 7, 2021 14:22
Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

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

@bramtervoort Thank you for working on this 🚀 . I think we should use the same pattern which we currently use in sulu for this kind of things, else it is getting confused having different implementation for the same kind of thing. I added some comments and did not yet have enough time to have a deeper look at the tests and the implementation but wanted to give you feedback as soon as it was possible.

Resources/config/services.xml Outdated Show resolved Hide resolved
Resources/config/services.xml Outdated Show resolved Hide resolved
Resources/config/services.xml Outdated Show resolved Hide resolved
Resources/config/services.xml Outdated Show resolved Hide resolved
Resources/config/services.xml Outdated Show resolved Hide resolved
Tests/Functional/Listener/FormRequestTest.php Outdated Show resolved Hide resolved
Tests/Functional/Listener/FormRequestTest.php Outdated Show resolved Hide resolved
Tests/Functional/Listener/FormRequestTest.php Outdated Show resolved Hide resolved
Tests/Unit/Mail/MailerHelperTest.php Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
@bramtervoort
Copy link
Contributor Author

Thank you Alexander for your feedback. It will be a couple of day's before I have the time to resolve them properly.

@alexander-schranz
Copy link
Member

alexander-schranz commented Jan 14, 2021

@bramtervoort no problem. Feel free to ping me here or over slack if you need any help.

@bramtervoort
Copy link
Contributor Author

i made some progress with this. next weekend ill be finishing this.

@alexander-schranz alexander-schranz changed the title added helper support sf mailer and configuration mechanism to switch Add helper support sf mailer and configuration mechanism to switch Jan 26, 2021
@bramtervoort
Copy link
Contributor Author

There all refactored, i just love that prophecy. I agree it looks much better now.

I refactored the form to a fixture if you don't agree I will be happy to turn it into a trait of course. Took some time to finish this all but i hope you can still have a look at it. Happy to resolve more review issues.

Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

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

@bramtervoort Thx for working on this. I added some more comments about the actual implementation.

DependencyInjection/Configuration.php Outdated Show resolved Hide resolved
DependencyInjection/Configuration.php Outdated Show resolved Hide resolved
DependencyInjection/Configuration.php Outdated Show resolved Hide resolved
DependencyInjection/SuluFormExtension.php Outdated Show resolved Hide resolved
DependencyInjection/SuluFormExtension.php Outdated Show resolved Hide resolved
Tests/Functional/Mail/Fixtures/LoadFormFixture.php Outdated Show resolved Hide resolved
Tests/Functional/Mail/Fixtures/LoadFormFixture.php Outdated Show resolved Hide resolved
Tests/Functional/Mail/HelperTest.php Show resolved Hide resolved
Tests/Unit/Mail/MailerHelperTest.php Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
@alexander-schranz
Copy link
Member

alexander-schranz commented Feb 24, 2021

@bramtervoort can you also rebase this branch to solve the conflicts and can you try to update your forks branches. I'm not sure why github action are not started for this PR but maybe it has todo that the fork branches are not up2date think it is worse a try.

@bramtervoort
Copy link
Contributor Author

@bramtervoort Thx for working on this. I added some more comments about the actual implementation.

Thx, I will check if can find a little time to work some more on this.

@bramtervoort bramtervoort force-pushed the feature/sf-mailer-in-form-bundle branch from b2504cc to 81e8e37 Compare May 9, 2021 09:18
@bramtervoort bramtervoort force-pushed the feature/sf-mailer-in-form-bundle branch from 81e8e37 to 1e94271 Compare May 29, 2021 08:47
@bramtervoort
Copy link
Contributor Author

There found the time to update this :D thank you for your patience. If i can do anything to fix or improve the code please let me know. ( sorry this took me so long ;) )

Bram Tervoort added 5 commits June 25, 2021 10:48
Created a mailer helper class to send emails using the new sf mailer
component. Created a configuration option to switch to varying mail
helpers.
refactored them as commented in the reviews
@alexander-schranz alexander-schranz force-pushed the feature/sf-mailer-in-form-bundle branch 2 times, most recently from e80418a to d8bdb63 Compare June 25, 2021 09:54
@alexander-schranz alexander-schranz force-pushed the feature/sf-mailer-in-form-bundle branch from d8bdb63 to 3cc458b Compare June 25, 2021 09:54
@alexander-schranz alexander-schranz merged commit 1494514 into sulu:2.x Jun 25, 2021
@alexander-schranz
Copy link
Member

@bramtervoort Thank you for contributing this 👍

@alexander-schranz alexander-schranz changed the title Add helper support sf mailer and configuration mechanism to switch Add symfony mailer integration Jun 25, 2021
@bramtervoort bramtervoort deleted the feature/sf-mailer-in-form-bundle branch June 26, 2021 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants