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 include Noketa open and click tracking by default. 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)
tostring | string[]Recipient email address or addresses
subjectstringEmail subject line
htmlstringOptional HTML body (full document or fragment). If omitted, Noketa generates a trackable HTML alternative from text.
textstringOptional plain-text part
replyTostringOptional reply-to address
trackingbooleanOptional. Defaults to true; set false to disable Noketa open/click tracking.
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>",
});

Tracking

By default, Noketa rewrites links for click tracking and adds an open pixel to the HTML part. That lets you see opens and clicks in the Noketa dashboard.

On Pro and Enterprise, verified sending domains can use a branded tracking host such as https://click.yourdomain.com. While that host is not active, Noketa automatically falls back to https://click.noketa.io so sends are not blocked.

Pass tracking: false to send without Noketa engagement tracking—your HTML and links are delivered unchanged (no rewrite, no pixel).

When to disable tracking

Turn tracking off for sensitive or security-critical mail where you want links to go directly to your app and avoid loading tracking assets:

  • Password resets and account-recovery flows
  • Magic links and one-time sign-in URLs
  • MFA, OTP, and verification codes
  • Other high-trust transactional messages where engagement metrics are not useful

These sends are usually one-off and action-oriented; open/click stats rarely inform product decisions the way they do for marketing email.

Example (tracking disabled)

await noketa.emails.send({
  from: "noreply@yourdomain.com",
  to: user.email,
  subject: "Reset your password",
  html: `<p><a href="${resetUrl}">Reset password</a></p>`,
  tracking: false,
});

Notes

  • html can be a complete HTML document or a fragment; the API accepts both.
  • When only text is supplied, Noketa sends it as the text part and generates a minimal HTML part for open/click tracking.
  • 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.