feat: add message mapping from MIME to Graph JSON format - #1
Conversation
|
Ciao Gabrio, thanks for the PR. This looks promising and like something I want to merge, but I will need some days until I get time to review it. Cheers, |
|
That's perfect, no hurry at all. |
|
Ciao Gabrio, sorry for the long wait on this! So HTML actually already works with the MIME path — One thing on the JSON side: for normal mail MIME does everything JSON does and more, so that path ends up dropping stuff (text fallback, reply_to, extra_headers, inline images). JSON only really buys you Graph-specific things like reference attachments or saveToSentItems, which this doesn't touch. Let me know if there's a case this package does not cover that you would like to add. Saluti! Daniel |
Understanding the possible issues with a custom mapping, the problem with previous implementation was that Django templates for html emails could not be used.
By adding a specific setting, we can maintain the plain mode for MIME email sending, and also enable the use of more advanced templates and the exploit of the Graph API.
I have added a few utility methods in MSGraphBackend to separate mapping and setting of headers and data for requests.