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

FieldTypeDescription
fromstringSender address (domain must be verified in your account)
tostringRecipient email address
subjectstringEmail subject line
htmlstringHTML body (full document or fragment)
textstringOptional plain-text part
replyTostringOptional reply-to address
unsubscribeUrlstringOptional absolute https URL for the List-Unsubscribe header
unsubscribeOneClickbooleanOptional. 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

  • html can be a complete HTML document or a fragment; the API accepts both.
  • Failed requests throw an Error with 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 unsubscribeUrl is invalid or not https, the API returns 400 with an error message.