Closed jqtruong closed 11 years ago
I'm not aware of anyone working on Mandrill template support. (I suspect many of us are using Django templates instead. But I haven't looked through all the early Djrill forks in detail -- maybe something in one of them?)
If you're interested in contributing some code (and tests), seems like Mandrill template support would be a welcome addition.
Thanks, i'll see what i can do.
On Mon, Dec 17, 2012 at 2:52 PM, Mike Edmunds notifications@github.comwrote:
I'm not aware of anyone working on Mandrill template support. (I suspect many of us are using Django templates instead. But I haven't looked through all the early Djrill forks in detail -- maybe something in one of them?)
If you're interested in contributing some code (and tests), seems like Mandrill template support would be a welcome addition.
— Reply to this email directly or view it on GitHubhttps://github.com/brack3t/Djrill/issues/19#issuecomment-11460875.
I've made an implementation of this. Adding a template_name attribute to the email object the send method will send the template:
msg = EmailMultiAlternatives(
subject="Djrill Message",
body="This is the text version of your email",
from_email="Djrill Sender <djrill@example.com>",
to=["Djrill Receiver <djrill.receiver@example.com>", "another.person@example.com"],
headers={'Reply-To': "Service <support@example.com>"} # optional extra headers
)
msg.template_name = "my_template"
msg.template_content = [{"name": "example_name", "content":"example content"}]
# Send it:
msg.send()
Thanks, I did not know that could be done without extending the EmailMessage class. On Dec 26, 2012 3:01 AM, "peillis" notifications@github.com wrote:
I've made an implementation of this. Adding a template_name attribute to the email object the send method will send the template:
msg = EmailMultiAlternatives( subject="Djrill Message", body="This is the text version of your email", from_email="Djrill Sender djrill@example.com", to=["Djrill Receiver djrill.receiver@example.com", "another.person@example.com"], headers={'Reply-To': "Service support@example.com"} # optional extra headers ) msg.template_name = "my_template" msg.template_content = [{"name": "example_name", "content":"example content"}]
Send it:
msg.send()
— Reply to this email directly or view it on GitHubhttps://github.com/brack3t/Djrill/issues/19#issuecomment-11683151.
@peillis, that's a nice API for using Mandrill's send_template. Would you be interested in submitting a pull request with your changes, so we could include this in the next Djrill release?
Of course. I can't do it right now, but I'll do it in a few days.
El 03/01/2013, a las 21:42, Mike Edmunds notifications@github.com escribió:
@peillis, that's a nice API for using Mandrill's send_template. Would you be interested in submitting a pull request with your changes, so we could include this in the next Djrill release?
— Reply to this email directly or view it on GitHub.
Pull request #21 implements this feature, and will go out in the next release. (Continuing to track this issue in #21 until then.)
Is there a way or has someone started work on integrating the /messages/send-template.json API call?