> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transmit.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Channel Communications

> Send emails, SMS, and voice messages through one unified API

## Overview

Transmit provides a unified platform for sending communications across multiple channels. Whether you need to send transactional emails, SMS notifications, or voice calls, you can do it all through a single API with consistent patterns and behaviors.

<Info>
  We're launching with TypeScript SDK support today. Additional SDKs, including Python, are on the roadmap—stay tuned.
</Info>

## Why Multi-Channel?

Modern applications need to reach users where they are. Different use cases call for different channels:

<CardGroup cols={2}>
  <Card title="Email" icon="envelope">
    Rich content, receipts, newsletters, detailed notifications
  </Card>

  <Card title="SMS" icon="message">
    Time-sensitive alerts, 2FA codes, delivery updates, urgent notifications
  </Card>

  <Card title="Voice" icon="phone">
    Critical alerts, two-factor authentication, appointment reminders
  </Card>

  <Card title="Unified Analytics" icon="chart-line">
    Track engagement across all channels in one dashboard
  </Card>
</CardGroup>

## Email Channel

### Capabilities

Email is perfect for rich, detailed communications:

* **Rich HTML content** with images, styling, and layouts
* **Attachments** for documents, invoices, and files
* **Templates** for consistent branding
* **Personalization** with dynamic content
* **Tracking** for opens, clicks, and engagement
* **Bulk sending** for newsletters and campaigns

### Quick Example

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.emails.send({
    from: 'notifications@yourdomain.com',
    to: 'user@example.com',
    subject: 'Order Confirmation #1234',
    html: `
      <h1>Thank you for your order!</h1>
      <p>Your order #1234 has been confirmed.</p>
      <a href="https://yourdomain.com/orders/1234">View Order</a>
    `,
    tracking: {
      opens: true,
      clicks: true
    }
  });
  ```
</CodeGroup>

### Best Practices

<AccordionGroup>
  <Accordion title="Verify Your Domain" icon="check-circle">
    Always verify your sending domain with SPF, DKIM, and DMARC records to improve deliverability and build sender reputation.
  </Accordion>

  <Accordion title="Use Plain Text Alternatives" icon="file-text">
    Include plain text versions of your emails for recipients who can't view HTML or prefer text-only emails.
  </Accordion>

  <Accordion title="Monitor Engagement" icon="chart-bar">
    Track open and click rates to optimize your email content and sending patterns.
  </Accordion>

  <Accordion title="Handle Bounces" icon="bounce">
    Monitor bounce events and remove hard-bounced addresses from your lists to maintain sender reputation.
  </Accordion>
</AccordionGroup>

## SMS Channel

### Capabilities

SMS is ideal for time-sensitive, high-priority communications:

* **High open rates** (98% within minutes)
* **Two-factor authentication** codes
* **Delivery notifications** and order updates
* **Appointment reminders**
* **Global reach** with international numbers
* **Unicode support** for emojis and special characters
* **Delivery receipts** for confirmation

### Quick Example

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.sms.send({
    from: '+1234567890',
    to: '+1987654321',
    body: 'Your verification code is 123456. Valid for 10 minutes.'
  });

  console.log('SMS sent:', response.id);
  console.log('Status:', response.status);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.transmit.dev/v1/sms \
    -H "Authorization: Bearer tx_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "from": "+1234567890",
      "to": "+1987654321",
      "body": "Your verification code is 123456. Valid for 10 minutes."
    }'
  ```
</CodeGroup>

### SMS Features

**Character Limits & Segmentation**

* Standard messages: 160 characters per segment
* Unicode messages: 70 characters per segment
* Automatically segments longer messages
* Track segment count for billing transparency

**Opt-In/Opt-Out Management**

* Built-in subscription management
* Automatic handling of STOP/START keywords
* Compliance with TCPA and carrier regulations
* Consent tracking and audit logs

**US Compliance (A2P 10DLC)**

* Automatic brand and campaign registration
* Improved deliverability on US carriers
* Reduced filtering and blocking
* Transparent registration status

### Best Practices

<AccordionGroup>
  <Accordion title="Obtain Consent" icon="handshake">
    Always get explicit opt-in consent before sending SMS. Include clear opt-out instructions in every message.
  </Accordion>

  <Accordion title="Be Concise" icon="align-left">
    Keep messages short and actionable. SMS is for urgent, important information only.
  </Accordion>

  <Accordion title="Mind the Timing" icon="clock">
    Send messages during appropriate hours (9 AM - 8 PM local time). Respect time zones.
  </Accordion>

  <Accordion title="Use Sender IDs" icon="id-badge">
    Use a recognizable sender ID or short code so recipients know who's messaging them.
  </Accordion>
</AccordionGroup>

## Voice Channel

### Capabilities

Voice calls provide the highest level of urgency and attention:

* **Critical alerts** that require immediate attention
* **Voice-based 2FA** for high-security scenarios
* **Appointment reminders** with confirmation
* **Text-to-speech** with natural voices
* **Call recording** and transcription
* **Interactive voice response (IVR)**
* **Global coverage** with local numbers

### Quick Example

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.voice.call({
    from: '+1234567890',
    to: '+1987654321',
    message: 'Hello, this is a reminder about your appointment tomorrow at 2 PM. Press 1 to confirm or 2 to reschedule.',
    voice: 'alice', // Natural-sounding voice
    language: 'en-US'
  });

  console.log('Call initiated:', response.id);
  ```
</CodeGroup>

### Voice Features

**Text-to-Speech**

* Natural-sounding voices in multiple languages
* Customizable speed and pitch
* Support for SSML (Speech Synthesis Markup Language)
* Pronunciation customization

**Call Flow Control**

* Gather user input via keypad (DTMF)
* Record caller responses
* Transfer to live agents
* Play hold music or messages

**Analytics**

* Call duration tracking
* Answer rate monitoring
* Recording and transcription access
* Failed call analysis

### Best Practices

<AccordionGroup>
  <Accordion title="Reserve for Critical Use Cases" icon="exclamation-triangle">
    Voice is the most intrusive channel. Use it only for urgent, high-priority communications.
  </Accordion>

  <Accordion title="Identify Yourself Early" icon="user">
    State who you are and why you're calling within the first few seconds.
  </Accordion>

  <Accordion title="Keep It Brief" icon="stopwatch">
    Respect the recipient's time. Get to the point quickly and provide clear next steps.
  </Accordion>

  <Accordion title="Provide Alternatives" icon="arrows-alt">
    Always offer text/SMS alternatives for non-critical information.
  </Accordion>
</AccordionGroup>

## Unified API Patterns

All channels in Transmit follow consistent patterns:

### Consistent Response Format

```json theme={null}
{
  "id": "msg_abc123",
  "status": "queued",
  "channel": "email|sms|voice",
  "createdAt": "2025-01-10T14:23:45Z"
}
```

### Unified Status Model

| Status      | Description                                 |
| ----------- | ------------------------------------------- |
| `queued`    | Message accepted and queued for sending     |
| `sending`   | Currently being sent                        |
| `sent`      | Successfully handed off to carrier/provider |
| `delivered` | Confirmed delivery to recipient             |
| `failed`    | Failed to deliver (with error details)      |
| `bounced`   | Rejected by recipient server/carrier        |

### Consistent Error Handling

```typescript theme={null}
try {
  const response = await client.sms.send({ /* ... */ });
} catch (error) {
  if (error.code === 'invalid_phone_number') {
    // Handle invalid number
  } else if (error.code === 'rate_limit_exceeded') {
    // Handle rate limiting
  }
}
```

## Channel Selection Guide

Choose the right channel for your use case:

| Use Case               | Recommended Channel | Why                                   |
| ---------------------- | ------------------- | ------------------------------------- |
| Order confirmations    | Email               | Rich content, receipt attachment      |
| 2FA codes              | SMS                 | Fast delivery, high open rate         |
| Password resets        | Email               | Clickable link, detailed instructions |
| Delivery notifications | SMS                 | Time-sensitive, mobile-first          |
| Critical system alerts | Voice → SMS → Email | Escalating urgency                    |
| Monthly newsletter     | Email               | Rich content, images, links           |
| Appointment reminders  | SMS + Email         | SMS for urgency, email for details    |
| Security breach alert  | Voice + Email       | Maximum urgency and detail            |

## Multi-Channel Campaigns

Send coordinated messages across multiple channels:

<CodeGroup>
  ```typescript TypeScript theme={null}
  // Send confirmation email + SMS
  const email = await client.emails.send({
    to: 'user@example.com',
    subject: 'Order Confirmed #1234',
    html: '<!-- detailed order confirmation -->'
  });

  const sms = await client.sms.send({
    to: '+1987654321',
    body: 'Order #1234 confirmed! Check your email for details.'
  });

  // Link them for unified tracking
  await client.campaigns.link({
    campaignId: 'order-confirmation',
    messages: [email.id, sms.id]
  });
  ```
</CodeGroup>

## Webhooks Across All Channels

Receive real-time events for all channels with consistent payload structure:

```json theme={null}
{
  "event": "message.delivered",
  "channel": "sms",
  "timestamp": "2025-01-10T14:23:45Z",
  "data": {
    "id": "msg_abc123",
    "to": "+1987654321",
    "status": "delivered",
    "deliveredAt": "2025-01-10T14:23:45Z"
  }
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Email Guide" href="/docs/guides/sending-emails" icon="envelope">
    Deep dive into email features
  </Card>

  <Card title="Analytics" href="/docs/guides/analytics" icon="chart-line">
    Track performance across all channels
  </Card>

  <Card title="Webhooks" href="/docs/guides/webhooks" icon="webhook">
    Set up real-time event notifications
  </Card>

  <Card title="API Reference" href="/api-reference/introduction" icon="book">
    Complete API documentation
  </Card>
</CardGroup>
