Emails
Send transactional and marketing emails through Noketa
Use the Emails API to send transactional email (one-off sends from your app). Marketing broadcasts are sent from the Noketa app and are not covered by this endpoint.
Transactional sends do not add open tracking, click tracking, or Noketa-hosted unsubscribe links to your HTML. You may optionally set unsubscribeUrl to add a List-Unsubscribe header pointing at your own HTTPS endpoint (similar to Resend’s transactional unsubscribe guidance).
Method
noketa.emails.send(payload: SendEmailRequest): Promise<SendEmailResponse>Request
| Field | Type | Description |
|---|---|---|
from | string | Sender address (domain must be verified in your account) |
to | string | Recipient email address |
subject | string | Email subject line |
html | string | HTML body (full document or fragment) |
text | string | Optional plain-text part |
replyTo | string | Optional reply-to address |
unsubscribeUrl | string | Optional absolute https URL for the List-Unsubscribe header |
unsubscribeOneClick | boolean | Optional. When true, Noketa adds List-Unsubscribe-Post: List-Unsubscribe=One-Click. Your unsubscribeUrl must accept POST per RFC 8058. Requires unsubscribeUrl. |
Example
import { Noketa } from "noketa";
const noketa = new Noketa(process.env.NOKETA_API_KEY!);
const response = await noketa.emails.send({
from: "noreply@yourdomain.com",
to: "person@example.com",
subject: "Welcome to Noketa",
html: "<h1>Welcome</h1><p>Thanks for signing up.</p>",
});Notes
htmlcan be a complete HTML document or a fragment; the API accepts both.- Failed requests throw an
Errorwith the message from the API; handle errors in try/catch. - For high-volume marketing sends, use Broadcasts in the Noketa app instead of looping this endpoint.
- If
unsubscribeUrlis invalid or nothttps, the API returns400with an error message.