Sign In

@profullstack/emailer

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@profullstack/emailer

Mass emailer for Profullstack apps — Resend batch API with SMTP fallback

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
452
24.18%
Maintainers
2
Weekly downloads
 
Created
Source

@profullstack/emailer

Mass emailer for Profullstack apps. Wraps Resend's batch API with a simple interface for sending bulk emails. Zero runtime dependencies.

Installation

npm install @profullstack/emailer

Usage

import { createEmailer } from '@profullstack/emailer';

const emailer = createEmailer({
  resendApiKey: process.env.RESEND_API_KEY,
});

Send a single email

const result = await emailer.send({
  from: 'App <noreply@example.com>',
  to: 'user@example.com',
  subject: 'Hello',
  html: '<p>Hello world</p>',
  text: 'Hello world',
});

// { sent: true, id: 're_...' }

Send a bulk email

const result = await emailer.sendBulk({
  from: 'App <noreply@example.com>',
  to: ['alice@example.com', 'bob@example.com', ...],
  subject: 'Big announcement',
  html: '<p>Something exciting</p>',
  text: 'Something exciting',
  batchSize: 100,  // default: 100 (Resend's batch limit)
  delayMs: 500,    // optional delay between batches
});

// { sent: 2, failed: 0, errors: [] }

Per-recipient personalization

Pass a function for html or text to customize per recipient:

await emailer.sendBulk({
  from: 'App <noreply@example.com>',
  to: emails,
  subject: 'Your weekly digest',
  html: (email) => `<p>Hi ${email}, here's your digest…</p>`,
});

API

createEmailer(config)

OptionTypeDescription
resendApiKeystringResend API key (required)
defaultFromstringDefault from address used when not provided per-call

emailer.send(opts)

OptionTypeDescription
fromstringSender (falls back to defaultFrom)
tostringRecipient
subjectstringSubject line
htmlstringHTML body
textstring?Plain-text body
replyTostring?Reply-to address
headersRecord<string,string>?Extra headers (e.g. List-Unsubscribe)
attachmentsArray<{filename,content}>?Base64-encoded attachments

Returns { sent: boolean, id?: string, error?: string }.

emailer.sendBulk(opts)

Same as send but to is string[], html/text can be a (email: string) => string function, plus:

OptionTypeDefaultDescription
batchSizenumber100Recipients per Resend batch call
delayMsnumber0Delay between batch calls

Returns { sent: number, failed: number, errors: Array<{email, error}> }.

License

MIT © Profullstack Inc

Keywords

email

FAQs

Package last updated on 14 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts