类别未添加到Sendgrid电子邮件发送中

时间:2019-09-11 07:44:26

标签: python sendgrid

我正在使用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())

0 个答案:

没有答案