Skip to main content
Integrate Lettr into your Node.js application to send transactional emails. Choose the guide that matches your framework. Using Cursor? Jump straight in using this prompt

Prerequisites

Before you begin, make sure you have:
  1. A Lettr account — sign up at app.lettr.com
  2. An API key created in your dashboard
  3. A verified sending domain
  4. Node.js 18 or higher

Choose Your Framework

Direct API Usage

For any Node.js application, you can send emails directly via the REST API using fetch:
const apiKey = 'lttr_xxxxxxxxxxxx';

const response = await fetch('https://app.lettr.com/api/emails', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from: 'you@yourdomain.com',
    to: ['recipient@example.com'],
    subject: 'Hello from Lettr',
    html: '<p>Your email content here.</p>',
  }),
});

const data = await response.json();
console.log(data);
For the full API reference, see the Send Email endpoint.