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 headers to emails before sending #871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ebeers-png
Copy link

I'd like to be able to send mail with custom headers. Currently, Messages can be initialized with header data through cloud data, but the field message_headers isn't included in the sending process. I made a simple edit to include message_headers in the data that gets sent with the post request.

To add a header to a message before sending:

message.message_headers = [{
    'name': 'X-customheader',
    'value': 'headervalue'
}]

The format of the dict is specified on this page of Microsoft's documentation, and the name must start with "X-" or "x-".

Let me know if there are other considerations to be mindful of here that I'm missing. Thanks!

@alejcas
Copy link
Member

alejcas commented Nov 11, 2022

I would like to check that this does not break a message when it's a draft that is to be sended...

Did you tried that?

Also, message_headers should respect tracking changes?
I mean you are including them always no matter if the message_headers have changed or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants