AWS SES
hono-email/aws-ses provides SesAdapter for Amazon SES. The adapter uses AWS SDK v3 to handle credentials, request signing, and delivery.
Installation
Section titled “Installation”Install the SDK only in applications that use SES:
npm i hono-email hono @aws-sdk/client-sesv2yarn add hono-email hono @aws-sdk/client-sesv2pnpm add hono-email hono @aws-sdk/client-sesv2bun i hono-email hono @aws-sdk/client-sesv2The SDK is an optional peer dependency and is not bundled into hono-email.
Example
Section titled “Example”import { SESv2Client } from '@aws-sdk/client-sesv2'import { Body, Html, Text } from 'hono-email'import { SesAdapter, sendEmail } from 'hono-email/aws-ses'
const client = new SESv2Client({ region: 'ap-northeast-1' })
const receipt = await sendEmail({ adapter: SesAdapter({ client }), from: { address: 'sender@example.com', name: 'Sender' }, to: ['recipient@example.com'], subject: 'Welcome', jsx: ( <Html> <Body> <Text>Hello from AWS SES.</Text> </Body> </Html> ),})
if (!receipt.successful) { console.error(receipt.errorMessages)}For the full list of configuration options, see the AWS SES Options API Reference.
Shared adapter features
Section titled “Shared adapter features”Like all provider adapters, AWS SES supports to, cc, bcc, replyTo, custom headers, and attachments. Inline attachments use cid when the provider supports content IDs.
Options
Section titled “Options”client Required
Section titled “client ”Type: SesClient
An AWS SDK v3 SESv2Client. Configure region, credentials, timeouts, and retries on this client.
configurationSetName Optional
Section titled “configurationSetName ”Type: string
Default SES configuration set.
tags Optional
Section titled “tags ”Type: Readonly<Record<string, string>>
Default SES event tags.
limits.maxAttachmentSize Optional
Section titled “limits.maxAttachmentSize ”Type: number
Maximum attachment size in bytes.