Function
_send_email_resend
(sender: str, to: str, subject: str, body: str, mailing)
Source from the content-addressed store, hash-verified
| 225 | |
| 226 | |
| 227 | def _send_email_resend(sender: str, to: str, subject: str, body: str, mailing): |
| 228 | from fastapi import HTTPException |
| 229 | resend.api_key = mailing.resend_api_key |
| 230 | try: |
| 231 | return resend.Emails.send({ |
| 232 | "from": sender, |
| 233 | "to": [to], |
| 234 | "subject": subject, |
| 235 | "html": body, |
| 236 | }) |
| 237 | except Exception as e: |
| 238 | logger.error("Resend email failed to %s: %s", to, e, exc_info=True) |
| 239 | raise HTTPException(status_code=503, detail="Email service temporarily unavailable") |
| 240 | |
| 241 | |
| 242 | _SMTP_TIMEOUT = 15 |
Tested by
no test coverage detected