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
| Field | Type | Description |
|---|---|---|
from | string | Sender address (domain must be verified in your account) |
to | string | string[] | Recipient email address or addresses |
subject | string | Email subject line |
html | string | Optional HTML body (full document or fragment). If omitted, Noketa generates a trackable HTML alternative from text. |
text | string | Optional plain-text part |
replyTo | string | Optional reply-to address |
tracking | boolean | Optional. Defaults to true; set false to disable Noketa open/click tracking. |
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>",
});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
htmlcan be a complete HTML document or a fragment; the API accepts both.- When only
textis supplied, Noketa sends it as the text part and generates a minimal HTML part for open/click tracking. - 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.