我正在使用Sendgrid Python库,并按照example中所述添加类别。电子邮件成功发送,但没有针对发送记录任何类别。
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email(email='Me <my@email.com>')
print(from_email)
subject = subject
to_email = Email(send_to)
content = Content("text/html", html)
bcc = 'my@email.com'
mail = Mail(from_email, subject, to_email, content)
mail.category = Category('my-category)
response = sg.client.mail.send.post(request_body=mail.get())