sabuhish / fastapi-mail

Fastapi mail system sending mails(individual, bulk) attachments(individual, bulk)
https://sabuhish.github.io/fastapi-mail/
MIT License
680 stars 82 forks source link

Unable to Attach Custom SMTP Headers #116

Closed SionAbes closed 2 years ago

SionAbes commented 2 years ago

👷 Problem

Unable to add custom SMTP headers to emails.

📄 Reason

To be able to attach custom data to mailgun using headers, which will allow us to track the status of emails (delivered, opened, rejected, etc..) with webhooks.

🔨 Solution

We use your library quite extensively at Tacto, and would like to open an PR to add this feature, but wanted to first discuss the options with you. As I see it, this would involve adding a new list of optional dicts to the MessageSchema and then updating the msg.py to handle the adding of this. On a quick search, we saw you already use the part.add_header().

What do you think?

sabuhish commented 2 years ago

@SionAbes please mind using 1.0.8, I had an issue with 1.0.7, I had to delete that release. Thanks again! Have a good evening! :)