[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/notifications](../README) / SmsChannel

# Class: SmsChannel

Defined in: [notifications/src/SmsChannel.ts:59](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/SmsChannel.ts#L59)

SMS notification channel — sends via Twilio or Vonage REST APIs.

No npm dependencies — uses the global fetch API.

Configure in config/notifications.ts:
  sms: {
    driver: 'twilio',
    twilio: {
      accountSid: Bun.env['TWILIO_ACCOUNT_SID'] ?? '',
      authToken:  Bun.env['TWILIO_AUTH_TOKEN']  ?? '',
      from:       Bun.env['TWILIO_FROM']         ?? '',
    },
  }

Usage in a Notification:
  channels() { return ['sms']; }
  toSms(_notifiable: Notifiable): SmsMessage {
    return { body: 'Your code is 1234' };   // delivered to notifiable.phone
  }

## Constructors

### Constructor

> **new SmsChannel**(`config`): `SmsChannel`

Defined in: [notifications/src/SmsChannel.ts:60](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/SmsChannel.ts#L60)

#### Parameters

##### config

[`SmsConfigShape`](../interfaces/SmsConfigShape)

#### Returns

`SmsChannel`

## Methods

### send()

> **send**(`notifiable`, `notification`): `Promise`\<`void`\>

Defined in: [notifications/src/SmsChannel.ts:62](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/SmsChannel.ts#L62)

#### Parameters

##### notifiable

`Notifiable`

##### notification

[`Notification`](Notification)

#### Returns

`Promise`\<`void`\>
