UNPKG

@vonage/messages

Version:

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

47 lines 1.51 kB
import { AbstractMessage } from '../AbstractMessage'; import { WhatsAppCustomType, WhatsAppCustomParams, WhatsAppContext } from '../../types'; import { MessageTypes } from '../../enums/MessageTypes'; import { Channels } from '../../enums'; /** * Represents a custom message for WhatsApp. * * @group WhatsApp */ export declare class WhatsAppCustom extends AbstractMessage implements WhatsAppCustomParams { /** * The channel for this message (always 'whatsapp'). */ channel: Channels.WHATSAPP; /** * The type of message (always 'custom'). */ messageType: MessageTypes; custom: WhatsAppCustomType; context?: WhatsAppContext; /** * Sends a custom message to a WhatsApp user. * * @param {WhatsAppCustomParams} params - The parameters for creating a WhatsApp custom message. * @example * ```ts * import { WhatsAppCustom } from '@vonage/messages'; * * const { messageUUID } = await messagesClient.send(new WhatsAppCustom({ * to: TO_NUMBER, * from: FROM_NUMBER, * custom: { * type: 'template', * template: { * namespace: 'your-namespace', * name: 'your-template-name', * }, * } * clientRef: 'my-personal-reference', * })); * * console.log(`Message sent successfully with UUID ${messageUUID}`); * ``` */ constructor(params: Omit<WhatsAppCustomParams, 'channel' | 'messageType'>); } //# sourceMappingURL=WhatsAppCustom.d.ts.map