{"_id":"@airnauts/comments-notifier-email","_rev":"4-87f1f2787ae780426b8635e64f5e54bf","name":"@airnauts/comments-notifier-email","dist-tags":{"latest":"0.7.0"},"versions":{"0.5.0":{"name":"@airnauts/comments-notifier-email","version":"0.5.0","keywords":["comments","commenting","annotations","feedback","airnauts","notifications","email","smtp","resend"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-notifier-email@0.5.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"26732296e9c366d1fabd350691d557cb475748a0","tarball":"https://registry.npmjs.org/@airnauts/comments-notifier-email/-/comments-notifier-email-0.5.0.tgz","fileCount":17,"integrity":"sha512-v9GMPZTqvfsYo1x/ZVps19MGgEKBS3y471zto6IDA9dhls/YMJ14ojSo4td1T3uRVVjhpfWoI6zgEREuI+5fVw==","signatures":[{"sig":"MEUCIQCEoZPsxML7KZjfsCTpLBlLU3+mQc3B209so2rQvGQZ1gIgP0ddQs1WevrpJnMgsiFanYSeORtYYMHCErdk1MZILEk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24076},"type":"module","_from":"file:airnauts-comments-notifier-email-0.5.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./smtp":{"types":"./dist/smtp.d.ts","import":"./dist/smtp.js"},"./resend":{"types":"./dist/resend.d.ts","import":"./dist/resend.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/828c246fe446539d71a1b4ddcc5c86d3/airnauts-comments-notifier-email-0.5.0.tgz","_integrity":"sha512-v9GMPZTqvfsYo1x/ZVps19MGgEKBS3y471zto6IDA9dhls/YMJ14ojSo4td1T3uRVVjhpfWoI6zgEREuI+5fVw==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/notifier-email"},"_npmVersion":"10.9.8","description":"Email notifier (SMTP + Resend) for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@airnauts/comments-core":"^0.5.1","@airnauts/comments-server":"^0.5.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nodemailer":"^6.9.0","@types/nodemailer":"^6.4.0","@airnauts/comments-test-support":"0.0.0"},"peerDependencies":{"nodemailer":">=6"},"peerDependenciesMeta":{"nodemailer":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/comments-notifier-email_0.5.0_1781002541904_0.577457854060563","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-extension-email — install that instead. No longer maintained."},"0.6.0":{"name":"@airnauts/comments-notifier-email","version":"0.6.0","keywords":["comments","commenting","annotations","feedback","airnauts","notifications","email","smtp","resend"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-notifier-email@0.6.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"7e1a2cd838f020971bf8b5a43f6a3a58295a07f4","tarball":"https://registry.npmjs.org/@airnauts/comments-notifier-email/-/comments-notifier-email-0.6.0.tgz","fileCount":17,"integrity":"sha512-qJr4MBejUWszICTeMgq2RH2fRxq1n2JCIIk3uA42swSaA+JcbZCFiA6tIdAehmIIXlyXhCrd9y8mq9wlkUFekw==","signatures":[{"sig":"MEUCIA7hEfHgfRmp0YF79ydzirY5DzQ+LT/T5A2mjGC2S6qRAiEA0Iw+geA7hlx7BDYExUK1EvdWVQebNd1fh/wTTNLPvv0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26532},"type":"module","_from":"file:airnauts-comments-notifier-email-0.6.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./smtp":{"types":"./dist/smtp.d.ts","import":"./dist/smtp.js"},"./resend":{"types":"./dist/resend.d.ts","import":"./dist/resend.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/3dc33363230bf763ca72bbc4001e5069/airnauts-comments-notifier-email-0.6.0.tgz","_integrity":"sha512-qJr4MBejUWszICTeMgq2RH2fRxq1n2JCIIk3uA42swSaA+JcbZCFiA6tIdAehmIIXlyXhCrd9y8mq9wlkUFekw==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/notifier-email"},"_npmVersion":"10.9.8","description":"Email notifier (SMTP + Resend) for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@airnauts/comments-core":"^0.6.0","@airnauts/comments-server":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nodemailer":"^6.9.0","@types/nodemailer":"^6.4.0","@airnauts/comments-test-support":"0.0.0"},"peerDependencies":{"nodemailer":">=6"},"peerDependenciesMeta":{"nodemailer":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/comments-notifier-email_0.6.0_1781537514053_0.02725868158810396","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-extension-email — install that instead. No longer maintained."},"0.7.0":{"name":"@airnauts/comments-notifier-email","version":"0.7.0","keywords":["comments","commenting","annotations","feedback","airnauts","notifications","email","smtp","resend"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-notifier-email@0.7.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"c881c970f8f93ae41efb179074229dd3bafba618","tarball":"https://registry.npmjs.org/@airnauts/comments-notifier-email/-/comments-notifier-email-0.7.0.tgz","fileCount":17,"integrity":"sha512-S/X1D46W6vFOMIsNUp/ZWPjoYTO/3UDBQ43sYq+87zvnxIW1QLX0X2ktANLJBfpFn8EZBpmWosUR+1yLVn6xFA==","signatures":[{"sig":"MEYCIQCB4GLROIni5gA0dmQDq9oPpF833scOrrGngf2Fwcso8QIhALwE3XuETvN4Xr/1MeHBC3pfzLG3KBnbDoX/F6bPvpk3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27223},"type":"module","_from":"file:airnauts-comments-notifier-email-0.7.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./smtp":{"types":"./dist/smtp.d.ts","import":"./dist/smtp.js"},"./resend":{"types":"./dist/resend.d.ts","import":"./dist/resend.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/7c4ce4f8ca4a170704fc86e6d79745b2/airnauts-comments-notifier-email-0.7.0.tgz","_integrity":"sha512-S/X1D46W6vFOMIsNUp/ZWPjoYTO/3UDBQ43sYq+87zvnxIW1QLX0X2ktANLJBfpFn8EZBpmWosUR+1yLVn6xFA==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/notifier-email"},"_npmVersion":"10.9.8","description":"Email notifier (SMTP + Resend) for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@airnauts/comments-core":"^0.7.0","@airnauts/comments-server":"^0.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nodemailer":"^6.9.0","@types/nodemailer":"^6.4.0","@airnauts/comments-test-support":"0.0.0"},"peerDependencies":{"nodemailer":">=6"},"peerDependenciesMeta":{"nodemailer":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/comments-notifier-email_0.7.0_1781540305056_0.6534490941817817","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-extension-email — install that instead. No longer maintained."}},"time":{"created":"2026-06-09T10:55:41.741Z","modified":"2026-06-16T09:42:57.658Z","0.5.0":"2026-06-09T10:55:42.075Z","0.6.0":"2026-06-15T15:31:54.197Z","0.7.0":"2026-06-15T16:18:25.202Z"},"bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"author":{"name":"Airnauts"},"license":"MIT","homepage":"https://github.com/Airnauts/commenting-tool#readme","keywords":["comments","commenting","annotations","feedback","airnauts","notifications","email","smtp","resend"],"repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/notifier-email"},"description":"Email notifier (SMTP + Resend) for the Airnauts commenting tool server.","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"readme":"# @airnauts/comments-notifier-email\n\nEmail notification extension for the [Airnauts commenting tool](https://github.com/Airnauts/commenting-tool) server. Emails the existing thread participants whenever someone replies — so reviewers are notified without a dedicated notification inbox.\n\n## Installation\n\n```bash\npnpm add @airnauts/comments-notifier-email\n# For SMTP transport only — not needed for the Resend transport:\npnpm add nodemailer\n```\n\n## Who gets notified\n\nRecipients are derived per event from the thread itself. On a reply (`comment.added`) the email goes to every other person who has commented, **excluding the reply author** (you are never emailed about your own comment). A brand-new thread (`thread.created`) has no other participants yet, so no email is sent. With more than one recipient, addresses go in `bcc` so participants do not see each other's emails.\n\n## Quick start\n\n### Resend (recommended for serverless / edge)\n\n```ts\nimport { createCommentsServer } from '@airnauts/comments-server'\nimport { emailExtension } from '@airnauts/comments-notifier-email'\nimport { resendTransport } from '@airnauts/comments-notifier-email/resend'\n\ncreateCommentsServer({\n  repository,\n  storage,\n  secretKey: process.env.COMMENTS_SECRET!,\n  projectId: 'my-app',\n  allowedOrigins: ['https://my-app.example.com'],\n  extensions: emailExtension({\n    transport: resendTransport({ apiKey: process.env.RESEND_API_KEY! }),\n    from: 'Comments <noreply@acme.com>',\n  }),\n})\n```\n\n### SMTP (Node server)\n\n```ts\nimport { emailExtension } from '@airnauts/comments-notifier-email'\nimport { smtpTransport } from '@airnauts/comments-notifier-email/smtp'\n\nextensions: emailExtension({\n  transport: smtpTransport({\n    host: 'smtp.example.com',\n    port: 587,\n    auth: { user: process.env.SMTP_USER!, pass: process.env.SMTP_PASS! },\n  }),\n  from: 'noreply@acme.com',\n  replyTo: 'support@acme.com',\n  subjectPrefix: '[Acme] ',\n})\n```\n\n## API reference\n\n### `emailExtension(opts)` (main entry)\n\n```ts\nemailExtension({\n  transport: EmailTransport   // Delivery backend (required)\n  from: string                // Verified sender address (required)\n  replyTo?: string            // Reply-To header\n  subjectPrefix?: string      // Prepended to every subject, e.g. \"[Acme] \"\n}): NotificationExtension[]\n```\n\nNotification failures are isolated — a hung or erroring transport never breaks the comment write.\n\n### `resendTransport(opts)` (`@airnauts/comments-notifier-email/resend`)\n\n```ts\nresendTransport({\n  apiKey: string  // Resend API key (required)\n}): EmailTransport\n```\n\nUses the Resend HTTP API; safe on edge runtimes. The request is bounded by a 5-second timeout.\n\n### `smtpTransport(opts)` (`@airnauts/comments-notifier-email/smtp`)\n\n```ts\nsmtpTransport({\n  host: string\n  port: number\n  auth: { user: string; pass: string }\n  secure?: boolean   // TLS on connect; default false (use for port 465)\n  pool?: boolean     // Reuse a connection pool across sends\n  timeout?: number   // Cap (ms) on connection/greeting/socket; default 10000\n}): EmailTransport\n```\n\nNode-only (uses `nodemailer`). Requires `nodemailer` to be installed separately. Not supported on edge runtimes.\n\n### `EmailTransport` interface\n\nImplement this to use any other email provider (SendGrid, SES, Postmark, …):\n\n```ts\ninterface EmailTransport {\n  readonly name: string\n  send(message: EmailMessage): Promise<void>\n}\n```\n\n### `formatEmail(event, opts?)`\n\n```ts\nimport { formatEmail } from '@airnauts/comments-notifier-email'\n\nconst { subject, html, text } = formatEmail(event, { subjectPrefix: '[Acme] ' })\n```\n\nRenders a `NotificationEvent` into an email. Exported for testing or custom dispatch.\n\n### Types\n\n| Export | From | Description |\n|---|---|---|\n| `EmailExtensionOptions` | `.` | Options for `emailExtension` |\n| `EmailTransport` | `.` | Pluggable delivery backend interface |\n| `EmailMessage` | `.` | `{ to, bcc?, from, replyTo?, subject, html, text }` |\n| `EmailFormat` | `.` | `{ subject: string; html: string; text: string }` |\n| `FormatEmailOptions` | `.` | `{ subjectPrefix?: string }` |\n| `ResendTransportOptions` | `./resend` | Options for `resendTransport` |\n| `SmtpTransportOptions` | `./smtp` | Options for `smtpTransport` |\n\n## Peer dependencies & requirements\n\n| Peer | Required | Notes |\n|---|---|---|\n| `nodemailer` | Optional (≥6) | Only needed for `@airnauts/comments-notifier-email/smtp` |\n\n- Node.js ≥ 18 for the Resend transport; Node.js ≥ 18 for SMTP (CJS, not edge-safe)\n\n## Related packages\n\n- **`@airnauts/comments-server`** — defines `NotificationExtension` and `NotificationEvent`\n- **`@airnauts/comments-notifier-slack`** — Slack notification alternative\n- **`@airnauts/comments-integration-jira`** — Jira thread-action extension\n\n## License\n\nMIT © Airnauts\n","readmeFilename":"README.md"}