Title: Getting HTTP 400 Bad request but email is getting delivered from sendgrid. · Issue #866 · sendgrid/sendgrid-python · GitHub
Open Graph Title: Getting HTTP 400 Bad request but email is getting delivered from sendgrid. · Issue #866 · sendgrid/sendgrid-python
X Title: Getting HTTP 400 Bad request but email is getting delivered from sendgrid. · Issue #866 · sendgrid/sendgrid-python
Description: Issue Summary I am getting a HTTP 400 Bad request response when calling sendgrid email, BUT THE EMAIL IS GETTING SENT OUT. I expect if error is getting returned then the email should not be delivered. Steps to Reproduce run snippet below...
Open Graph Description: Issue Summary I am getting a HTTP 400 Bad request response when calling sendgrid email, BUT THE EMAIL IS GETTING SENT OUT. I expect if error is getting returned then the email should not be deliver...
X Description: Issue Summary I am getting a HTTP 400 Bad request response when calling sendgrid email, BUT THE EMAIL IS GETTING SENT OUT. I expect if error is getting returned then the email should not be deliver...
Mail addresses
no-reply@securityadvisor.io
rohan@securityadvisorbot.com
rohan@securityadvisor.io
rohan@securityadvisor.io
Opengraph URL: https://github.com/sendgrid/sendgrid-python/issues/866
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Getting HTTP 400 Bad request but email is getting delivered from sendgrid.","articleBody":"\r\n### Issue Summary\r\nI am getting a HTTP 400 Bad request response when calling sendgrid email, BUT THE EMAIL IS GETTING SENT OUT. I expect if error is getting returned then the email should not be delivered.\r\n\r\n### Steps to Reproduce\r\n1. run snippet below.\r\n\r\n### Code Snippet\r\nsg = sendgrid.SendGridAPIClient(settings.SENDGRID_API_KEY)\r\n template_data = Content(\"text/html\", template)\r\n to_email = Email(to_email)\r\n mail = Mail(from_email, subject, to_email, template_data)\r\n response = sg.client.mail.send.post(request_body=mail.get())\r\n\r\nHere is the output of mail.get()\r\n{ \r\n \"from\":{ \r\n \"email\":\"no-reply@securityadvisor.io\"\r\n },\r\n \"subject\":\"Employees trainings are due on 2020-01-24\",\r\n \"personalizations\":[ \r\n { \r\n \"to\":[ \r\n { \r\n \"email\":\"\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"content\":[ \r\n { \r\n \"type\":\"text/html\",\r\n \"value\":\"\u003c!DOCTYPE html\\n PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n\u003chtml xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\\n\\n\u003chead>\\n \u003cmeta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n \u003cmeta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n \u003ctitle>SecurityAdvisor\u003c/title>\\n \u003cstyle type=\\\"text/css\\\">\\n table,\\n td {\\n mso-table-lspace: 0;\\n mso-table-rspace: 0 !important\\n }\\n\\n span.preheader {\\n display: none !important;\\n }\\n\\n @media only screen and (max-width: 768px) {\\n table[class=contentTableOuter] {\\n width: 95%\\n }\\n\\n table[class=contentTableInner] {\\n width: 95%;\\n margin: 0 auto\\n }\\n\\n table[class=fLeft],\\n table[class=fRight] {\\n width: 100%;\\n margin-bottom: 10px;\\n border: none\\n }\\n\\n table[class=fLeft] td,\\n table[class=fRight] td {\\n height: auto;\\n border: none;\\n text-align: center\\n }\\n\\n img[class=resImg] {\\n width: 100% !important;\\n height: auto !important\\n }\\n\\n .d-none {\\n display: none\\n }\\n }\\n\\n \u003c/style>\\n\u003c/head>\\n\\n\u003cbody>\\n\u003ctable width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" bgcolor=\\\"#ececec\\\">\\n \u003ctr>\\n \u003ctd align=\\\"center\\\" valign=\\\"top\\\" bgcolor=\\\"#ececec\\\" height=\\\"20\\\"> \u003c/td>\\n \u003c/tr>\\n \u003ctr>\\n \u003ctd align=\\\"center\\\" valign=\\\"top\\\" bgcolor=\\\"#ececec\\\">\\n\\n \u003ctable width=\\\"700\\\" border=\\\"0\\\" align=\\\"center\\\" cellpadding=\\\"10\\\" cellspacing=\\\"0\\\" class=\\\"contentTableOuter\\\">\\n \u003ctr>\\n \u003ctd align=\\\"center\\\" valign=\\\"top\\\" bgcolor=\\\"#FFFFFF\\\">\\n \u003ctable width=\\\"600\\\" border=\\\"0\\\" align=\\\"center\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"contentTableInner\\\">\\n \u003ctr>\\n \u003ctd align=\\\"left\\\" valign=\\\"top\\\">\\n \u003ctable width=\\\"100%\\\" border=\\\"0\\\" align=\\\"left\\\" cellpadding=\\\"20\\\" cellspacing=\\\"0\\\" class=\\\"fLeft\\\">\\n \u003ctr>\\n \u003ctd align=\\\"center\\\" valign=\\\"middle\\\">\\n \u003ca href=\\\"https://www.securityadvisor.io/\\\" target=\\\"_blank\\\">\\n \u003cimg src=\\\"https://logouploadtest.s3.amazonaws.com/OrganisationLogo/305cd33aa1cc49ba945eb86844e1683c\\\" alt=\\\"\\\" width=\\\"300\\\" border=\\\"0\\\" />\u003c/a>\u003c/td>\\n \u003c/tr>\\n \u003c/table>\\n \u003c/td>\\n \u003c/tr>\\n \u003ctr>\\n \u003ctd align=\\\"left\\\" valign=\\\"top\\\">\\n \u003chr width=\\\"100%\\\" size=\\\"1\\\" noshade=\\\"noshade\\\" style=\\\"border:1px solid #f1f1f2\\\">\\n \u003c/td>\\n \u003c/tr>\\n \u003ctr>\\n \u003ctd height=\\\"20\\\" align=\\\"left\\\" valign=\\\"top\\\"> \u003c/td>\\n \u003c/tr>\\n \u003ctr contenteditable=\\\"true\\\">\\n \u003ctd style=\\\"padding: 15px;\\\">\\n \u003cp style=\\\"font-size: 15px;\\\">Hello \u003cb>Manager\u003c/b>\u003c/p>\u003cbr>\\n \u003cp>This is a reminder. The following trainings are due to be completed by the users by January 24, 2020\u003cp>\u003c/p>\\n \u003cul>\\n \\n \u003cli>\\n \u003cp>California Consumer Privacy Act : \u003ca href=\\\"https://localhost:8001/gw/c2c7f4bd55754f068fff5a13f4d1d243/\\\"> Click here to start \u003c/a> \u003c/p>\\n \u003c/li>\\n \\n \u003c/ul>\\n \u003cbr>\\n \u003cp> Users List\u003c/p>\\n \u003cul>\\n \\n \u003cli>\\n \u003cp>Yahoo Yahoo last name - rohan@securityadvisorbot.com\u003c/p>\\n \u003c/li>\\n \\n \u003cli>\\n \u003cp>rohan@securityadvisor.io - rohan@securityadvisor.io\u003c/p>\\n \u003c/li>\\n \\n \u003c/ul>\\n\\n \u003cp>Regards,\u003c/p>\\n \u003cp>Your Information Security Team\u003c/p>\\n \u003c/p>\\n \u003c/td>\\n \u003c/tr>\\n \u003c/table>\\n \u003c/td>\\n \u003c/tr>\\n\\n \u003ctr>\\n \u003ctd align=\\\"right\\\" valign=\\\"top\\\" bgcolor=\\\"#666666\\\"\\n style=\\\"font-size: 13px; font-family:Arial, Helvetica, sans-serif; color:#ffffff\\\">\\n\\n Powered by SecurityAdvisor\\n \u003ca href=\\\"https://www.securityadvisor.io\\\" target=\\\"_blank\\\" style=\\\"color:#fff; text-decoration: none\\\">\\n \u003cimg src=\\\"https://content.securityadvisor.io/static/assets/images/securityadvisor-logo-footer.png\\\"\\n align=\\\"center\\\" width=\\\"120\\\" alt=\\\"SecurityAdvisor\\\" border=\\\"0\\\" class=\\\"\\\" style=\\\"padding-left:10px\\\" />\u003c/a>\\n \u003c/td>\\n \u003c/tr>\\n\\n \u003ctr>\\n \u003ctd align=\\\"center\\\" valign=\\\"top\\\" bgcolor=\\\"#ececec\\\"\\n style=\\\"font-size: 12px; font-family:Arial, Helvetica, sans-serif; color:#666\\\">\\n You received this email because your organization is registered with SecurityAdvisor. Please contact your\\n administrator to unsubscribe.\\n \u003cbr> \u003cbr>\\n We respect your privacy. View our \u003ca href=\\\"https://www.securityadvisor.io/sabweb/privacy\\\" target=\\\"_blank\\\"\\n style=\\\"color:#666\\\">Privacy Policy\u003c/a>.\\n \u003c/td>\\n \u003c/tr>\\n\\n \u003c/table>\\n \u003c/td>\\n \u003c/tr>\\n\\n \u003ctr>\\n \u003ctd align=\\\"center\\\" valign=\\\"top\\\" bgcolor=\\\"#ececec\\\" height=\\\"20\\\"> \u003c/td>\\n \u003c/tr>\\n\u003c/table>\\n\u003c/body>\\n\\n\u003c/html>\\n\"\r\n }\r\n ]\r\n}\r\n\r\n### Exception/Log\r\nHTTP Error 400: Bad Request\r\n\r\n### Technical details:\r\n* sendgrid-python version:5.6.0\r\n* python version:3.7.4\r\n\r\n","author":{"url":"https://github.com/r-puri","@type":"Person","name":"r-puri"},"datePublished":"2020-01-23T18:48:59Z","url":"https://github.com/sendgrid/sendgrid-python/issues/866"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e52e70f0-576a-814a-006d-cdc803985d9a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C170:11EACE:2A13B5C:3838CD1:6B01BE53 |
| html-safe-nonce | c4368ca5c36b2fbad634ebe46a1e20516eef731705d9f765d94a21e3f842c3c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTcwOjExRUFDRToyQTEzQjVDOjM4MzhDRDE6NkIwMUJFNTMiLCJ2aXNpdG9yX2lkIjoiNTE5NTIyNTY2NDYwODkxMDkzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 98663ea6cff1f40b22b9da6ff01a495d628d71dd084726e8fea722984812e1fb |
| hovercard-subject-tag | issue:554338345 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sendgrid/sendgrid-python/866/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a75a373681da24168006eb58f9fddaaf43de9f792990e7d289c4614d21581519/sendgrid/sendgrid-python/issues/866 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a75a373681da24168006eb58f9fddaaf43de9f792990e7d289c4614d21581519/sendgrid/sendgrid-python/issues/866 |
| og:image:alt | Issue Summary I am getting a HTTP 400 Bad request response when calling sendgrid email, BUT THE EMAIL IS GETTING SENT OUT. I expect if error is getting returned then the email should not be deliver... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | r-puri |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/sendgrid/sendgrid-python git https://github.com/sendgrid/sendgrid-python.git |
| octolytics-dimension-user_id | 181234 |
| octolytics-dimension-user_login | sendgrid |
| octolytics-dimension-repository_id | 3546794 |
| octolytics-dimension-repository_nwo | sendgrid/sendgrid-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3546794 |
| octolytics-dimension-repository_network_root_nwo | sendgrid/sendgrid-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width