Skip to main content
zerotal

Documentation


Documentation / @zerotal/notifications / SmsMessage

Interface: SmsMessage

Defined in: notifications/src/SmsChannel.ts:18

Payload returned by notification.toSms().

Example

toSms(_notifiable: Notifiable): SmsMessage {
  return { body: `Your verification code is ${this.code}` };
}

Properties

to?

optional to?: string

Defined in: notifications/src/SmsChannel.ts:23

Recipient phone number in E.164 format, e.g. '+15551234567'. Optional — it defaults to the notifiable's phone, so most notifications omit it.


body

body: string

Defined in: notifications/src/SmsChannel.ts:25

Message body text.


from?

optional from?: string

Defined in: notifications/src/SmsChannel.ts:30

Sender number or alphanumeric ID. Overrides the global from in config/notifications.ts when set.