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

Send Mailchimp Template possibility? #19

Closed jqtruong closed 11 years ago

jqtruong commented 11 years ago

Is there a way or has someone started work on integrating the /messages/send-template.json API call?

medmunds commented 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.

jqtruong commented 11 years ago

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.

peillis commented 11 years ago

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()
jqtruong commented 11 years ago

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.

medmunds commented 11 years ago

@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?

peillis commented 11 years ago

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.

medmunds commented 11 years ago

Pull request #21 implements this feature, and will go out in the next release. (Continuing to track this issue in #21 until then.)