Skip to content

improvement(resend): add error handling, authMode, and naming consistency#3382

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/validate-resend
Feb 28, 2026
Merged

improvement(resend): add error handling, authMode, and naming consistency#3382
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/validate-resend

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add createLogger and error handling to all 7 direct-API tool files
  • Add authMode: AuthMode.ApiKey to block config
  • Add .trim() on ID fields in URL paths
  • Move optional send-email fields (cc, bcc, replyTo, scheduledAt, tags) to advanced mode
  • Add wandConfig for scheduledAt (timestamp) and tags fields
  • Add missing block outputs (scheduledAt, unsubscribed)
  • Add optional: true on nullable tool outputs
  • Rename mailSendTool to resendSendTool for naming consistency
  • Use ?? instead of || for null-coalescing in response transforms

Type of Change

  • Improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 28, 2026 7:12pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 28, 2026

Greptile Summary

This PR systematically improves the Resend integration across all tool files and block configuration.

Key Changes

  • Error Handling: Added createLogger and comprehensive error handling to all 7 direct-API tool files (get_email, create_contact, delete_contact, get_contact, update_contact, list_contacts, list_domains) with proper error responses and logging
  • Input Validation: Added .trim() on ID fields (emailId, contactId) in URL paths to prevent whitespace-related API errors
  • Block Configuration: Added authMode: AuthMode.ApiKey to the Resend block config
  • UI Improvements: Moved optional send-email fields (contentType, cc, bcc, replyTo, scheduledAt, tags) to advanced mode for cleaner default UI
  • AI Features: Added wandConfig for scheduledAt (timestamp generation) and tags fields to enable AI-powered field generation
  • Schema Completeness: Added missing block outputs (scheduledAt, unsubscribed) and marked nullable tool outputs as optional
  • Naming Consistency: Renamed mailSendTool to resendSendTool across all files for consistent naming convention
  • Safer Null Handling: Replaced || with ?? operator for null-coalescing in response transforms to avoid falsy value bugs

The changes follow consistent patterns, add defensive programming practices, and maintain backward compatibility while improving robustness and user experience.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are defensive improvements that add error handling, input validation, and better null-coalescing without modifying core business logic. The consistent patterns across all 7 tool files, proper error responses, and improved type safety make this a low-risk enhancement.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/resend.ts Added authMode, moved optional fields to advanced mode, added wandConfig for scheduledAt and tags, and added missing outputs (scheduledAt, unsubscribed)
apps/sim/tools/resend/get_email.ts Added logger, error handling, .trim() on emailId, ?? operator for null-coalescing, and optional: true on nullable outputs
apps/sim/tools/resend/create_contact.ts Added createLogger and comprehensive error handling with proper error responses
apps/sim/tools/resend/delete_contact.ts Added logger, error handling, .trim() on contactId, and ?? operator for null-coalescing
apps/sim/tools/resend/get_contact.ts Added logger, error handling, .trim() on contactId, and ?? operator for null-coalescing
apps/sim/tools/resend/update_contact.ts Added logger, error handling, and .trim() on contactId in URL path
apps/sim/tools/resend/list_contacts.ts Added createLogger, error handling for API errors, and ?? operator for null-coalescing
apps/sim/tools/resend/list_domains.ts Added logger, error handling, and ?? operator for null-coalescing in transformResponse

Last reviewed commit: bef36ec

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 96096e0 into staging Feb 28, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/validate-resend branch February 28, 2026 19:19
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.

1 participant