brack3t / Djrill

[INACTIVE/UNMAINTAINED] Djrill is an email backend and new message class for Django users that want to take advantage of the Mandrill transactional email service from MailChimp.
BSD 3-Clause "New" or "Revised" License
319 stars 64 forks source link

Nested merge vars #88

Closed nikolaz111 closed 9 years ago

nikolaz111 commented 9 years ago

Is there a way to send a complex object through merge vars? Mandrill supports any json object to be sent through merge vars. It would be veeeeeeery nice to be able to send something like a list that has many dicts which also have lists, etc.

medmunds commented 9 years ago

Djrill uses Python's standard json package to encode the Mandrill API calls, so dict and list merge vars should get converted to json in the usual ways.

What happens when you try it?

nikolaz111 commented 9 years ago

The problem was that one of my nested objects wasn't a standard python dict. It was a different kind of dict, so I had to convert the object to json first and then re parse the info so that everything was json serializable. It works. Thanks

nikolaz111 commented 9 years ago

By the way, I had to use a custom encoder for json transformation.