Skip to main content

Overview

The Send Message module provides comprehensive methods for sending various message types, managing interactions, and controlling chat on WhatsApp. Build engaging, feature-rich messaging experiences with safe sending options, link previews, and more.

Text Methods

Send various types of content to engage your audience with multimedia and interactive elements.

Safe Send Text Message

Safely send a WhatsApp text message with human-like pacing. (learn more)
  • Basic usage
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->safeSendTextMessage(
      chat_id: '[email protected]',
      text: 'Hello from Laravel package!',
  );

Send Text Message

Send plain text messages with link preview (optional) (learn more)
We highly recommend using the send-text-safe endpoint for regular messaging operations to maintain a more natural communication pattern, and keep your whatsapp number safe from being blocked.
  • Basic usage
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->sendText(
      chat_id: '[email protected]',
      text: 'Hello from Laravel package!',
  );

Send Image Message

Send images to WhatsApp users via URL or file upload. (learn more)
  • Using URL
  • Parameters
  • Using File Upload
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->sendImageUrl(
        chat_id: '[email protected]',
        url: 'https://hypersender.com',
        fileName: 'image.jpeg',
        mimetype: 'image/jpeg',
        caption: 'Check out this image!',
        reply_to: 'string',
  );

Send Video Message

Send videos to WhatsApp users via URL or file upload. (learn more)
  • Using URL
  • Parameters
  • Using File Upload
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->sendVideoUrl(
        chat_id: '[email protected]',
        url: 'https://example.com/video.mp4',
        asNote: false,
        caption: 'Check out this video!',
        reply_to: 'string',
  );
You can send videos only in mp4 formats - so make sure the url contains the correct extensionMax allowed file size is 20MB.

Send Voice Message

Send voice messages to WhatsApp users via URL or file upload. (learn more)
  • Using URL
  • Parameters
  • Using File Upload
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
    ->sendVoiceUrl(
        chat_id: '[email protected]',
        url: 'https://example.com/audio.opus',
        caption: 'Check out this audio!',
        reply_to: 'string',
    );

Send Location Message

Send location messages to WhatsApp users. (learn more)
  • Basic Usage
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
    ->sendLocation(
        chat_id: '[email protected]',
        latitude: '37.7749',
        longitude: '-122.4194',
        title: 'San Francisco',
        reply_to: 'string',
    );

Send Poll Message

Send poll messages to WhatsApp users. (learn more)
  • Basic Usage
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
    ->sendPoll(
        chat_id: '[email protected]',
        reply_to: 'string',
        poll: [
            'name' => 'Sample Poll',
            'options' => [
                'Option 1',
                'Option 2',
                'Option 3'
            ],
            'multipleAnswers' => true
        ]
    );
Send a text message with a custom link preview. (learn more)
  • Using URL
  • Parameters
  • Using File Upload
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->sendLinkCustomPreviewUrl(
      chatId: '[email protected]',
      text: 'Check this out: https://example.com',
      replyTo: null,
      highQuality: true,
      previewTitle: 'Example Title',
      previewDescription: 'A short description for the preview card',
      previewUrl: 'https://example.com',
      previewImageUrl: 'https://example.com/image.jpg',
  );

Send File Message

Send any file type via URL or file upload. (learn more)
  • Using URL
  • Parameters
  • Using File Upload
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->sendFileUrl(
      chatId: '[email protected]',
      url: 'https://example.com/files/report.pdf',
      fileName: 'report.pdf',
      mimeType: 'application/pdf',
      caption: 'Monthly report',
      replyTo: null,
  );

Send Contact Card

Send contact cards (vCard) to WhatsApp users. (learn more)
  • Basic Usage
  • Parameters
use Hypersender\Hypersender;

Hypersender::whatsapp()
  ->sendContactCard(
      chatId: '[email protected]',
      contacts: [
          [
              'vcard' => "BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nORG:Acme Inc\nTEL;type=CELL:+12025550123\nEND:VCARD",
              'fullName' => 'John Doe',
              'organization' => 'Acme Inc',
              'phoneNumber' => '12025550123',
              'whatsappId' => '[email protected]',
          ],
      ],
  );
Each contact supports: vcard, fullName, organization, phoneNumber, whatsappId.You can send one or multiple contacts in a single message by including multiple items in the contacts array.
I