我正在学习将django python与sendgrid api结合使用。目前,我可以成功发送电子邮件,但我想使电子邮件更具吸引力并应用某些CSS样式。我在网上寻找了一些帮助,但找不到任何帮助。有人可以建议我该怎么做吗?
这是我到目前为止尝试过的
def sendemail(sender,recipient,subject,content,url):
sg = sendgrid.SendGridAPIClient(apikey="*****")
from_email = Email(sender)
to_email = Email(recipient)
subject = subject
content = Content("text", content+url)
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())
print(response.status_code)
print(response.body)
print(response.headers)