Skip to content

SimpleNotificationSystem/plugin-resend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@simplens/resend

Resend email provider plugin for SimpleNS.

Features

  • 📧 Send HTML emails via Resend
  • 🖼️ Automatic base64 image extraction to CID attachments
  • 🔄 Template variable replacement ({{var}}, ${var}, {var}, $var)
  • ⚡ Built-in rate limiting (configurable)
  • ✅ Full TypeScript support

Installation

npm install @simplens/resend

Configuration

Add to your simplens.config.yaml or generate using npx @simplens/config-gen gen @simplens/resend:

providers:
  - package: '@simplens/resend'
    id: email-resend
    credentials:
      RESEND_API_KEY: ${RESEND_API_KEY}
      FROM_EMAIL: ${FROM_EMAIL}
    options:
      rateLimit:
        maxTokens: 100      # Max emails in bucket
        refillRate: 100     # Tokens refilled per interval
        refillInterval: day # second | minute | hour | day

Required Credentials

Credential Description
RESEND_API_KEY Your Resend API key (get one here)
FROM_EMAIL Verified sender email address (verify domain)

Notification Schema

Field Type Required Description
channel 'email' Must be 'email'
recipient.user_id string User identifier
recipient.email string Valid email address
content.subject string Email subject line
content.html string HTML content (must contain at least one HTML tag)
variables Record<string, unknown> Template variables

Rate Limiting

Resend free tier allows 100 emails/day. Configure based on your plan:

Plan Suggested Config
Free maxTokens: 100, refillRate: 100, refillInterval: day
Pro maxTokens: 5000, refillRate: 5000, refillInterval: day

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Manual test (requires .env with RESEND_API_KEY, FROM_EMAIL, TO_EMAIL)
npm run test:send

License

MIT

Author

SimpleNS Team

About

Official Resend plugin for SimpleNS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published