-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Mailer] Add MicrosoftGraph API Transport #60408
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
- added mail text body handling - removed unused properties - added composer deps
src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Transport/MicrosoftGraphTransport.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com>
@creiner Great work so far 👍🏻 This PR looks stalled and I see there are some conflicts. Can you solve those? Would love to see this merged soon! (would also be fine with taking this over and create an updated implementation if you'd like). |
use Symfony\Component\Mime\Part\DataPart; | ||
use Symfony\Component\Mime\RawMessage; | ||
|
||
class MicrosoftGraphTransport implements TransportInterface |
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.
Why is the interface being used directly, instead of the AbstractApiTransport
? That would also remove the need of the Email
check in the send
method.
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.
Good point! I will have a look at it this weekend.
I'm currently working on an alternative implementation that does not pull the complete MS SDK dependency. |
To avoid duplicated efforts, it would be helpful to understand which approach is preferred by the Symfony team? |
What is the alternative to using the Microsoft SDK? |
…ver) This PR was squashed before being merged into the 7.4 branch. Discussion ---------- [Mailer] Add MicrosoftGraph API Transport | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | yes <!-- if yes, also update src/**/CHANGELOG.md --> | Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md --> | Issues | Alternative for #60408 <!-- prefix each issue number with "Fix #"; no need to create an issue if none exists, explain below --> | License | MIT <!-- 🛠️ Replace this text with a concise explanation of your change: - What it does and why it's needed - A simple example of how it works (include PHP, YAML, etc.) - If it modifies existing behavior, include a before/after comparison Contributor guidelines: - ✅ Add tests and ensure they pass - 🐞 Bug fixes must target the **lowest maintained** branch where they apply https://symfony.com/releases#maintained-symfony-branches - ✨ New features and deprecations must target the **feature** branch and must add an entry to the changelog file of the patched component: https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - 🔒 Do not break backward compatibility: https://symfony.com/bc --> Add a new Mailer bridge for the Microsoft Graph API, but without adding the complete Microsoft SDK as we're talking about just two HTTP POST requests. I continued the work done in #60408 and kept the names mentioned there in the composer definition, but this implementation has been made from scratch, is based on the existing Azure Bridge and supports more features such as priority and inline attachments. Commits ------- 7a1e3fb [Mailer] Add MicrosoftGraph API Transport
This PR has it beggining in #52546 and I implemented the changes from the comments by stof.
There is one thing I'm unsure with:
#52546 (comment)
The microsoft.kiota dependency is added and managed via the microsoft-graph -> microsoft-graph-core -> microsoft/kiota-authentication-phpleague-php package.
I'm unsure about pinning one of the transitive dependencies to a fixed version?
I think then we should also add the other microsoft/kiota-* packages there.