question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plain text emails from dynamic templates

See original GitHub issue

Hi,

It might be not an issue of this library, however, I would like to post this information in case someone else would run into similar issues. Today we noticed that our HTML dynamic template emails were sent out as plain text. We correlated the issue with the recent change on the Sendgrid side.

Out fix was to set content type explicitly

email = EmailMessage(from_email=email_from, to=[to])
# <<<
email.content_subtype = 'html'
# >>>

email.dynamic_template_data = ...
email.send(fail_silently=False)

Thanks, Hena

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sklarsacommented, Jan 16, 2020

I’ll take a look at this over the weekend and maybe I can come up with a fix that makes sense

On Jan 16, 2020, at 3:56 PM, Ivy Cheung notifications@github.com wrote:

Having the same issue as well, sending it through the Email API works fine but when sending it through our platform which uses this library also sends it through plain text

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

1reaction
ivycheung7commented, Jan 16, 2020

Having the same issue as well, sending it through the Email API works fine but when sending it through our platform which uses this library it also sends emails as plain text, thanks for opening this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Classic email builder plain text template
Learn how you can design a plain text template in Omnisend. ... HTML emails, may not only enhance your emails with dynamic content...
Read more >
Dynamic sendgrid templates being sent as plain text
Given that dynamic templates contain both HTML and plain text content, text should not be passed when using a dynamic template.
Read more >
How to Send an Email with Dynamic Templates
Before you begin. Before you create and send an email using a dynamic template, you need to do the following: Create a SendGrid...
Read more >
Dynamic Email Templates - MailerSend
Create dynamic emails with text/HTML. Skip the templates and write your own text/HTML dynamic emails to send via API call or SMTP. Easily...
Read more >
HTML vs Plain Text Email: Which Works Better in 2023?
Plain text emails are plain while HTML emails are super attractive. Learn in detail about the better email format for your email campaign....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found