feat: add attachment support to Resend adapter#113
Conversation
Resend's API supports attachments with base64-encoded content. Remove the exception that blocked attachments and add proper handling with MAX_ATTACHMENT_BYTES (25MB) validation, matching the SMTP adapter.
Greptile SummaryThis PR enables attachment support in the Resend email adapter by removing the blocking exception and implementing proper attachment handling that is consistent with the existing SMTP adapter. Key changes:
All three issues raised in the previous round of review have been addressed. The implementation aligns well with the SMTP adapter pattern and the Resend API specification. Confidence Score: 5/5Safe to merge — all prior P1 issues are resolved and no new issues were found. All three previous P1 findings (silent file_get_contents failure, silent filesize failure, missing content_type) are explicitly addressed in this revision. The implementation is consistent with other adapters in the codebase (SMTP), the error paths are properly guarded, and the new tests provide solid coverage of the main scenarios. No remaining P0 or P1 issues. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: address PR review comments" | Re-trigger Greptile |
- Add error handling for filesize() returning false on unreadable paths - Add error handling for file_get_contents() returning false - Include content_type field in Resend attachment payload
Summary
getPath()) or string-based (getContent()) attachments and include them in the Resend API payloadMAX_ATTACHMENT_BYTES(25MB), consistent with the SMTP adapterTest plan
testSendEmailWithFileAttachment— sends email with a file-path-based attachmenttestSendEmailWithStringAttachment— sends email with raw string content attachmenttestSendEmailWithAttachmentExceedingMaxSize— verifies 25MB limit throws exception (passes locally)