Skip to content

Best way to track message sourced from existing record. #219

Answered by medmunds
chrisgrande asked this question in Q&A
Discussion options

You must be logged in to vote

What you're doing should work. Extra headers are sent in the message to the recipient, so don't use this if invite-id needs to be kept private from them. One caution: some ESPs will reject non-standard email headers, so 'invite-id' could cause an error. Email standards allow all custom headers with an x- prefix, so 'x-invite-id' would be more reliable.

There are three other approaches you might consider. Whether they'd be easier or cleaner will depend on your code and your tastes…

First, you can add your own custom attributes to any Python object, so rather than using extra_headers you could just assign message.invite_id before sending, and then read that same attribute in your post_send

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@chrisgrande
Comment options

@medmunds
Comment options

@chrisgrande
Comment options

Answer selected by chrisgrande
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants