I'm trying to use sendgrid to send email from my Python application.
It's sending fine using the mail helper and the following syntax:
sgmessage = mail.Mail(from_email, message.subject, to_email, content)
sg.client.mail.send.post(request_body=sgmessage.get())
But I can't find the way to send an email which has a multipart/alternative content type with text & html versions?
I've tried things like this:
sgmessage = mail.Mail(from_email, message.subject, to_email)
sgmessage.add_content(content)
sgmessage.add_content(htmlcontent)
But that gives me Bad Request when I try to send.
Could someone point me to the documentation or other tip for achieving this?
Also attachments -- I can't find docs for that handy mail helper which would help me add attachments ability to my code.