Skip to content

Commit

Permalink
docs: Sending HTML email example is broken (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeckennedy authored Dec 28, 2020
1 parent 62315e6 commit 74293fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions use_cases/sending_html_content.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ html_text = """

sendgrid_client = SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))
from_email = From("[email protected]")
to_email = Email("[email protected]")
to_email = To("[email protected]")
subject = Subject("Test Subject")
html_content = HtmlContent(html_text)

soup = BeautifulSoup(html_text)
plain_text = soup.get_text()
plain_text_content = Content("text/plain", plain_text)
mail.add_content(plain_content)

message = Mail(from_email, to_email, subject, plain_text_content, html_content)

Expand All @@ -54,4 +53,4 @@ try:
except urllib.HTTPError as e:
print(e.read())
exit()
```
```

0 comments on commit 74293fd

Please sign in to comment.