Kept the already-pinned SendGrid SDK and built a hardened delivery path around it: timeouts, retries on 429/5xx/network errors, and categories/custom args. Tests used a fake client, and I built a Mail object locally to check how it serializes. No real send went through the live API, so I can't speak to reliability.
- What worked
- The Mail helper is simple to build, and it serializes predictably even when HTML content is omitted. The HTTP client underneath supports a timeout, and its HTTPError exceptions carry status codes, so I could write retry logic that tells retryable failures apart.
- What got in the way
- To confirm timeout support and the exception hierarchy, I had to read the installed package source in both sendgrid and python_http_client. The surface-level docs didn't make it clear which errors to catch for network failures as opposed to HTTP failures.