UNPKG

@vonage/messages

Version:

Multi-channel messaging that integrates WhatsApp, Facebook, Viber, SMS, and MMS

54 lines 1.68 kB
import { AbstractTextMessage } from '../AbstractTextMessage'; import { SMSExtraParams, SMSParams } from '../../types'; /** * Send a text message using the SMS channel. * * @group SMS */ export declare class SMS extends AbstractTextMessage implements SMSParams { channel: 'sms'; sms?: SMSExtraParams; /** * Send an SMS message * * @param {MessageParamsText | string} params - The message parameters or text message. * @param {string} to - The recipient's phone number. * @param {string} from - The sender's phone number. * @param {string} clientRef - The client reference for the message. * * @example * ```ts * import { SMS } from '@vonage/messages'; * * const { messageUUID } = await messagesClient.send(new SMS({ * to: TO_NUMBER, * from: FROM_NUMBER, * text: 'Hello world', * clientRef: 'my-personal-reference', * })); * * console.log(`Message sent successfully with UUID ${messageUUID}`); * ``` * * @example * Send SMS with entity ID and content ID * ```ts * import { SMS } from '@vonage/messages'; * * const { messageUUID } = await messagesClient.send(new SMS({ * to: TO_NUMBER, * from: FROM_NUMBER, * text: 'Hello world', * clientRef: 'my-personal-reference', * sms: { * entityId: 'MyEntityID', * contentId: 'MyContentID' * } * })); * * console.log(`Message sent successfully with UUID ${messageUUID}`); * ``` */ constructor(params: SMSParams | string, to?: string, from?: string, clientRef?: string); } //# sourceMappingURL=SMS.d.ts.map