Skip to main content
Send with html, text, or both at the top level:
const res = await contiguity.email.send({
  to: ["user@example.com", "ops@example.com"],
  from: "Your App <no-reply@yourapp.com>",
  subject: "Welcome!",
  html: "<h1>Hello</h1>",
  reply_to: "support@yourapp.com",
  cc: "manager@example.com"
});
Providing content via body: { text, html, react } is deprecated but still supported. Prefer top-level html, text, and react.

React Email

Pass a React Email component as react; the SDK renders it to HTML and plain text before sending. Install @react-email/render and its peer deps when using this:
bun add @react-email/render react react-dom
Define a component (e.g. Email.tsx):
import * as React from 'react';
import { Html, Button } from "@react-email/components";

export function Email(props) {
  const { url } = props;

  return (
    <Html lang="en">
      <Button href={url}>Click me</Button>
    </Html>
  );
}

export default Email;
Then pass it to react:
import { Email } from "./Email";

await contiguity.email.send({
  to: "user@example.com",
  from: "Your App <no-reply@yourapp.com>",
  subject: "Welcome",
  react: <Email url="https://example.com" />,
});

Parameters

email.send(params)

to
string | string[]
required
Recipient email or array of recipients (max 10).
from
string
required
The sender’s email address. Can include a display name: "Your App <no-reply@yourapp.com>"
subject
string
required
The email subject line.
html
string
HTML version of the email content. Use html, text, and/or react (one or more required).
text
string
Plain text version of the email content.
react
ReactNode
A React Email component; the SDK renders it to HTML and plain text. Requires @react-email/render, react, and react-dom.
body
object
Deprecated. Use top-level html, text, and react instead. Still supported: body: { text?, html?, react? }.
reply_to
string
Email address for replies. If not specified, replies will go to the from address.
cc
string | string[]
Carbon copy recipients. Can be a single email address or an array of addresses.
bcc
string | string[]
Blind carbon copy recipients. Can be a single email address or an array of addresses.
headers
object[]
Custom email headers as an array of objects with name and value properties.

Response

email_id
string
Unique identifier for the sent email, used for tracking delivery status and analytics.
metadata
object
Request metadata including ID, timestamp, and API version.