Closed erichennings closed 10 years ago
I think that's a great idea. Please do submit a pull request.
You probably could just call the attribute mandrill_response
. (For better or worse, Djrill has never namespaced the attributes it allows on message objects; it would somehow seem inconsistent to start doing that with a single attribute now.)
Thanks for the suggestion.
I'm interested in getting the _id that Mandrill returns when you call their send api.
I think them returning it is fairly new. Getting this value is useful because you can then directly query the status of that message without using a webhook.
Of course we can't return this value directly from DjrillBackend._send() because Django defines the signature of that method.
As an idea, what about adding either the id or the full response json to the message that was sent as a property, probably prefacing with 'djrill' for the sake of namespacing. It could be done by adding either:
message.djrill_mandrill_id = response.json()[0].get('_id', None)
or, for the full response (I like this better),message.djrill_mandrill_response = response.json()[0]
just before the final return True in DjrillBackend._send
Then someone who wanted this value could do:
Thoughts? Happy to submit a pull request if this concept makes sense.
--Eric