Skip to content

feat: add Resend email API fake service#35

Open
rotemtam wants to merge 2 commits intomainfrom
feat/resend
Open

feat: add Resend email API fake service#35
rotemtam wants to merge 2 commits intomainfrom
feat/resend

Conversation

@rotemtam
Copy link
Collaborator

@rotemtam rotemtam commented Mar 1, 2026

Summary

  • Adds a complete Resend email API fake service with 10 scenarios covering the core API surface
  • 52 contract tests grounded against the real Resend API, all passing
  • Scenarios: email sending lifecycle, scheduled emails, batch sending, domain/contact/template/API key management, webhook configuration, template-email integration, and error handling
  • Includes da-agent .memory/ research artifacts for future reference

Test plan

  • All 52 tests pass against the fake server (0 failures)
  • 40 tests pass against real Resend API grounding (12 skipped as fake_only due to free-tier account limits)
  • CI pipeline validates the service

🤖 Generated with Claude Code

Adds a full Resend API fake covering 10 scenarios: email sending lifecycle,
scheduled emails, batch sending, domain/contact/template/API key management,
webhook configuration, template-email integration, and error handling.
52 contract tests grounded against the real Resend API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract sender email from display name format before asserting,
avoiding substring check that CodeQL flagged as incomplete URL sanitization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
"Missing `subject` field.",
)

# 4. `from` required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Template send incorrectly requires from in request.

POST /emails enforces from before applying template defaults, so a request that relies on template from fails with 422 even though template defaults should be usable when request fields are omitted.

if not text:
return text

def replace_var(match):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Template variables can trigger 500.

_substitute_template_variables returns raw values from variables; if a value is numeric (allowed by Resend), re.sub receives a non-string replacement and the request fails with HTTP 500 instead of a normal API response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants