Add type-safe sendEmail helper with generics

- New sendEmail<T>() helper that extends BaseEmailData for full type safety
- Supports both template-based and direct HTML emails
- Automatic email validation and address parsing
- Merges template output with custom data fields
- Full TypeScript autocomplete for custom Email collection fields
- Updated README with comprehensive examples and API reference
- Exports BaseEmailData and SendEmailOptions types for external use

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-13 20:30:55 +02:00
parent f8b7dd8f4c
commit cb5ce2e720
3 changed files with 209 additions and 21 deletions

View File

@@ -21,4 +21,7 @@ export {
renderTemplate,
processEmails,
retryFailedEmails,
sendEmail,
type BaseEmailData,
type SendEmailOptions,
} from './utils/helpers.js'