Closed SionAbes closed 2 years ago
Just some extra testing: We implemented this fork into our production stack, and it appears to be working as intended. The only hiccup is that you do have to stringify the value of the header if its a sub dict eg:
from json import dumps
{"custom_header": dumps({"my_id":1})}
Good evening @SionAbes, Thanks a lot for your great job. I loved the way you explained things in detail, made us happier. I used mailgun
once with my teammates, never realized such things at that time. Thanks for first finding the issue and without hesitating you have created PR. That is beautiful and very kind of you! I will release a new version, instead of fork, you can download it from pypi.
What? ✨
Allows users to add custom SMTP headers to email requests
Related to this issue raised on Custom SMTP Headers
Why? 📝
Some email providers allow users to attach custom SMTP headers for specific operations, such as custom ids to track the status of mails with webhooks. I thought this would be a great little feature to add to fastapi-mail.
How? 🔧
MessageSchema
pydantic model.add_headers
function from python emails, attached the key and value of each header in the dict to the message.