feat(inboxes): accept path attachments on drafts

DI
11h ago
+25-5

Resend::Inboxes::Drafts.create and .update now document path attachments. The API accepts them (resend/resend-monorepo#13475, live). Spec: resend/resend-openapi#141. Node reference: resend/resend-node#1172 (released in 6.36.0).

Changes

  • Drafts pass attachments to the API unchanged, so no code change was needed. The create doc comment now says each attachment needs a filename and either content + content_type or a path URL. A path file is downloaded when the request is made, and content_type defaults to the downloaded file's type. update refers to create.
  • Specs for a path attachment on create and update.
  • Version 1.18.0 → 1.19.0 (minor), in its own commit together with Gemfile.lock.

Verification

  • bundle exec rubocop finds no offenses. bundle exec rake spec runs 480 examples with 0 failures.
  • Live against api.resend.com through the SDK:
    • create with path stored invoice.pdf (application/pdf, 80893 bytes)
    • update with path + content stored both files
    • an ftp:// path raises InvalidRequestError (422)

Linear: DEV-2422


Summary by cubic

Documents path attachments for Resend::Inboxes::Drafts.create and .update. Attachments already pass through to the API unchanged, so this PR only updates the docs, adds specs, and bumps the version to 1.19.0.

  • The create doc comment now says each attachment needs a filename and either content with content_type, or a path URL that is downloaded when the request is made; content_type defaults to the downloaded file's type, and an undownloadable path returns a 422.
  • Adds path attachment specs for create and update, using a placeholder URL.