Skip to content

Commit 74293fd

Browse files
authored
docs: Sending HTML email example is broken (#962)
1 parent 62315e6 commit 74293fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

use_cases/sending_html_content.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ html_text = """
3535

3636
sendgrid_client = SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))
3737
from_email = From("[email protected]")
38-
to_email = Email("[email protected]")
38+
to_email = To("[email protected]")
3939
subject = Subject("Test Subject")
4040
html_content = HtmlContent(html_text)
4141

4242
soup = BeautifulSoup(html_text)
4343
plain_text = soup.get_text()
4444
plain_text_content = Content("text/plain", plain_text)
45-
mail.add_content(plain_content)
4645

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

@@ -54,4 +53,4 @@ try:
5453
except urllib.HTTPError as e:
5554
print(e.read())
5655
exit()
57-
```
56+
```

0 commit comments

Comments
 (0)