Send an email with Thinwrap (TypeScript)

Send transactional email via the Thinwrap unified Email facade in TypeScript — same call shape for SendGrid, AWS SES, Resend, and every other supported provider.

1. Install

npm install @thinwrap/notifications

2. Send the call

import { Email } from '@thinwrap/notifications';

const email = new Email('sendgrid', {
  apiKey: process.env.SENDGRID_API_KEY!,
  from: 'noreply@example.com',
});

const result = await email.send({
  from: 'noreply@example.com',
  to: 'user@example.com',
  subject: 'Hello from Thinwrap',
  text: 'Hello world',
});

// result.status is 'sent' | 'queued' | 'rejected' | 'suppressed' | 'unknown'
// result.providerMessageId is the upstream message id, or null
console.log(result.status, result.providerMessageId);

Same code works for all supported providers — just change the provider ID.