lavr / python-emails

Modern python library for emails
http://python-emails.readthedocs.org
Other
405 stars 54 forks source link

Lazy rendering and transform.save() issue #78

Closed vgavro closed 6 years ago

vgavro commented 7 years ago

Greetings. Seems like creating message from template for later rendering and applying transformers doesn't work one with another? Like I see all other message methods, for example dkim signature works lazy, so I can do something like this:

msg = Message(subject=Template(), html=Template())
msg.dkim(**dkim_options)

and later msg.send(to, render=context) But transformer.save() modifies not rendered template, but template.template_text before rendering (for example this would not work properly with extending template from base). I should not use template feature in this case, or what's the proper way to do this? Also maybe there should be method of Message to implement, that can modify message after template rendering? Thanks for your help and ideas... Really cool lib, by the way. Thanks

lavr commented 7 years ago

Hi! Not sure I understand your problem. Could you send more details? I'd like to see what exactly is Template, and what kind of content is in template.