Overview

The CrunchzApp SDK provides two distinct methods for sending WhatsApp messages, each designed for different use cases and requirements. Understanding the differences between these methods will help you implement the most efficient messaging strategy for your application.

Message Sending Methods

Parallel Method

The Parallel method allows you to stack multiple operations and send them as a batch. This approach is ideal when you want to:

  • Create a natural messaging flow with typing indicators
  • Send multiple messages in sequence
  • Combine different types of actions in a single request
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
    ->contact('xxx@c.us')
    ->startTyping()
    ->text('This is a message from you')
    ->text('Another text message from me')
    ->stopTyping()
    ->sendPool();

The Parallel method executes all operations in the order they are chained, making it perfect for simulating natural conversation patterns with typing indicators.

Single Method

The Single method executes each operation immediately when the ->send() method is called. This approach is ideal when you want to:

  • Send individual messages with immediate execution
  • Handle responses for each message separately
  • Implement conditional logic between messages
use CrunchzApp\CrunchzApp;

// Send a text message
CrunchzApp::channel()
    ->contact('xxx@c.us')
    ->text('This is a message from you')
    ->send();

// Send another message
CrunchzApp::channel()
    ->contact('xxx@c.us')
    ->text('Another text message')
    ->send();

When using the Single method, each operation requires a separate API call, which may impact performance if you’re sending many messages in sequence.

Choosing Between Methods