Skip to main content
Send transactional emails from AWS Lambda using Lettr’s HTTP API. Lambda’s event-driven architecture pairs perfectly with Lettr — no persistent connections, no background workers, just simple HTTP requests. Using Cursor? Jump straight in using this prompt

Prerequisites

Before you begin, make sure you have:

API Key

Create an API key in the Lettr dashboard

Verified Domain

Add and verify your sending domain
You’ll also need:
  • AWS account with Lambda access and appropriate IAM permissions
  • Node.js 18.x or 20.x runtime
  • AWS CLI installed and configured (optional, but recommended)

Quick Setup

1

Create a Lambda function

Create a new Lambda function in the AWS Console or via AWS CLI:
2

Add environment variables

Set your Lettr API key as an environment variable:
For production, use AWS Secrets Manager instead of environment variables. See the Advanced Guide for details.
3

Deploy your function

Deploy the function code (see examples below) and test it:

Node.js Implementation

Install the SDK in your Lambda function:
Then create your handler:
The Lettr SDK automatically handles retries for transient failures and provides better error messages than raw fetch calls.

What’s Next

Advanced Guide

Learn about deployment strategies, event triggers, and best practices

Vercel Functions

Deploy on Vercel

Cloudflare Workers

Deploy on Cloudflare

API Reference

Complete API documentation