Skip to main content
The email capability sends transactional emails through reliable email infrastructure.

Providers

ProviderFeatures
ResendModern API, high deliverability

Basic Usage

const result = await saturn.email({
  to: 'user@example.com',
  subject: 'Welcome to our service',
  text: 'Thanks for signing up!',
});

console.log(result.data.messageId);
// → Unique message ID for tracking

Parameters

to
string | string[]
required
Recipient email address(es).
subject
string
required
Email subject line.
text
string
Plain text body.
html
string
HTML body (alternative to text).
from
string
Sender email address. Defaults to configured address.
replyTo
string
Reply-to address.

Response

interface EmailResponse {
  data: {
    messageId: string;  // Unique message ID
    status: string;     // 'sent', 'queued'
  };
  metadata: {
    chargedUsdCents: number;
    provider: string;
    latencyMs: number;
    auditId: string;
  };
}

Examples

HTML Email

const result = await saturn.email({
  to: 'user@example.com',
  subject: 'Your weekly report',
  html: `
    <h1>Weekly Report</h1>
    <p>Here's your summary for this week:</p>
    <ul>
      <li>Tasks completed: 15</li>
      <li>Hours logged: 40</li>
    </ul>
  `,
});

Multiple Recipients

const result = await saturn.email({
  to: ['alice@example.com', 'bob@example.com'],
  subject: 'Team update',
  text: 'Important team announcement...',
});

With AI-Generated Content

async function sendPersonalizedEmail(
  to: string,
  topic: string,
  context: string
) {
  // Generate email content with LLM
  const content = await saturn.reason({
    prompt: `Write a professional email about: ${topic}
    Context: ${context}
    Keep it concise and friendly.`,
  });

  // Send the email
  return saturn.email({
    to,
    subject: `Update: ${topic}`,
    text: content.data.content,
  });
}

Pricing

ProviderCost
Resend~$0.001 per email

Domain Configuration

To send from your own domain, you’ll need to configure DNS records (SPF, DKIM, DMARC). Contact support for custom domain setup.
By default, emails are sent from a Saturn-managed domain. For production use, configure your own sending domain for better deliverability.

Best Practices

  • Always include a plain text version for accessibility
  • Keep subjects under 50 characters
  • Don’t send unsolicited emails (spam)
  • Include unsubscribe options for marketing emails
  • Test emails before sending to large lists