Send WhatsApp Business API Messages Directly from Google Spreadsheet Using MySmsMantra API

 


Send WhatsApp Business API Messages Directly from Google Spreadsheet Using MySmsMantra API

In today’s fast-paced digital world, WhatsApp Business messaging has become one of the most effective ways to connect with customers instantly. Businesses use WhatsApp to send order updates, confirmations, reminders, and promotional offers - all in real-time. But what if you could send these WhatsApp messages directly from something as simple as a Google Spreadsheet?

That’s exactly what you can do with MySmsMantra WhatsApp Business API integration. This guide explains how you can send personalized WhatsApp messages directly from Google Sheets using MySmsMantra’s reliable API - saving time, reducing manual effort, and boosting engagement.

 

Why Use Google Spreadsheet for WhatsApp Messaging?

Google Sheets isn’t just a data tool - it’s a powerhouse for automation. Most businesses already use it to manage leads, customer lists, and campaign data. With MySmsMantra API integration, you can transform your spreadsheet into a WhatsApp communication dashboard.

Here’s why this integration makes sense:

1.     Ease of Use:
No coding expertise required. You can manage everything from a spreadsheet.

2.     Bulk Messaging:
Send personalized WhatsApp messages to hundreds or thousands of contacts in one go.

3.     Real-Time Communication:
Deliver instant updates - whether it’s payment confirmations, booking alerts, or event reminders.

4.     Seamless Automation:
Link Google Sheets with MySmsMantra API to automate notifications based on data changes.

5.     Cost-Effective:
Skip expensive CRM tools - your spreadsheet and MySmsMantra’s API are all you need.

 

About MySmsMantra WhatsApp Business API

MySmsMantra is a leading bulk messaging and communication API provider, offering businesses secure, fast, and scalable solutions for SMS, WhatsApp, and RCS messaging.

With the WhatsApp Business API, MySmsMantra allows businesses to:

  • Send transactional, promotional, or template-based messages.
  • Include media attachments like images, PDFs, and videos.
  • Personalize messages dynamically (using variables like name, order ID, etc.).
  • Access real-time delivery reports.
  • Integrate easily with Google Sheets, CRMs, and third-party apps.

This makes MySmsMantra ideal for businesses that want to automate customer communication without heavy technical setup.

 

Use Case Examples

Before we dive into the technical setup, let’s see how this integration can help different industries:

  • 🏨 Travel Agencies: Send booking confirmations or itinerary updates to customers listed in Google Sheets.
  • 🏫 Educational Institutes: Notify students or parents about fee reminders, results, or event updates.
  • 🛍️ E-Commerce Businesses: Send order tracking links or discount alerts automatically.
  • 💼 Corporate Teams: Share meeting links, reminders, or announcements instantly.
  • 💰 Finance Sector: Send EMI alerts, payment confirmations, or loan updates.

 

Step-by-Step Guide: Send WhatsApp Messages from Google Spreadsheet Using MySmsMantra API

Let’s walk through how you can connect your Google Spreadsheet with MySmsMantra API.

 

Step 1: Get MySmsMantra WhatsApp API Credentials

1.     Sign up on MySmsMantra.com.

2.     Once logged in, navigate to the API section under your account dashboard.

3.     Copy your API key, Sender ID, and WhatsApp template details.

4.     Keep these credentials handy - you’ll need them for the Google Script integration.

 

Step 2: Prepare Your Google Spreadsheet

Create a new Google Sheet with the following columns:

Name

Mobile Number

Message

Status

Raj

919911004450

Hello Raj, your booking is confirmed.

Pending

Meena

9188009898

Hi Meena, your payment of ₹5000 is received.

Pending

Each row represents a recipient. You can also include personalized columns such as order ID, payment amount, or dates.

 

Step 3: Open Google Apps Script

1.     In your Google Sheet, go to Extensions → Apps Script.

2.     Delete any existing code and paste the script below.

 

Step 4: Insert the Script for MySmsMantra API

function sendWhatsAppMessages() {

  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();

  const data = sheet.getDataRange().getValues();

 

  // Replace with your MySmsMantra API details

  const apiKey = "YOUR_API_KEY";

  const sender = "YOUR_SENDER_ID";

 

  for (let i = 1; i < data.length; i++) {

    const name = data[i][0];

    const mobile = data[i][1];

    const message = data[i][2];

    const status = data[i][3];

 

    if (status !== "Sent") {

      const payload = {

        api_key: apiKey,

        sender: sender,

        number: mobile,

        message: message

      };

 

      const options = {

        method: "post",

        contentType: "application/json",

        payload: JSON.stringify(payload)

      };

 

      const url = "https://api.mysmsmantra.com/whatsapp/send"; // Example endpoint

      const response = UrlFetchApp.fetch(url, options);

      const result = JSON.parse(response.getContentText());

 

      if (result.status === "success") {

        sheet.getRange(i + 1, 4).setValue("Sent");

      } else {

        sheet.getRange(i + 1, 4).setValue("Failed");

      }

 

      Utilities.sleep(1000); // To avoid rate limit issues

    }

  }

}

 

Step 5: Authorize the Script

  • Click the Run button for the first time.
  • Google will ask for permissions to connect your spreadsheet and external APIs.
  • Approve the permissions to enable message sending.

 

Step 6: Automate the Process (Optional)

If you want messages to be sent automatically:

1.     Go to Triggers → Add Trigger.

2.     Choose the function sendWhatsAppMessages.

3.     Set it to run every 5 minutes or every hour.

This ensures your spreadsheet automatically sends WhatsApp messages whenever new entries are added.

 

Advantages of This Integration

Zero Coding Effort:
The script is simple and can be modified even by non-developers.

Personalized Messaging:
Use dynamic fields like names, amounts, and dates for a personal touch.

Bulk Delivery:
Send hundreds of messages at once from your spreadsheet.

Real-Time Updates:
Automatically mark messages as “Sent” or “Failed” in your Google Sheet.

Scalable & Secure:
MySmsMantra’s WhatsApp Business API ensures reliability and compliance with WhatsApp policies.

 

Pro Tips for Better Messaging Automation

  • Use Pre-Approved Templates:
    WhatsApp requires template approval for business messages. Create and get templates approved via MySmsMantra before sending bulk notifications.
  • Segment Your Contacts:
    Divide your Google Sheet data by campaign type (marketing, transactional, reminder) for better targeting.
  • Add Media Messages:
    You can modify the script to include images, PDFs, or videos using MySmsMantra’s media API endpoint.
  • Track Performance:
    Use delivery reports or add a column to store MySmsMantra’s response IDs for tracking.
  • Respect Opt-Out Rules:
    Always give customers an option to unsubscribe to comply with WhatsApp Business regulations.

 

Real-World Example

Let’s say you run a travel agency and manage all your customer bookings in Google Sheets.

Each time a booking is confirmed, you add a new row with the traveler’s name, mobile number, and message content like:
“Hi [Name], your booking for Shimla trip on [Date] is confirmed. Thank you for choosing us!”

With the MySmsMantra API integrated script, the moment you hit “Run,” all your travelers receive personalized WhatsApp confirmations instantly — no need to copy-paste or use multiple platforms.

 

Common Issues and Troubleshooting

Issue

Possible Cause

Solution

Messages not sending

Invalid API key

Recheck your MySmsMantra credentials

“Authorization required” error

Script not authorized

Run the script manually once and allow permissions

Status not updating

Wrong column index

Ensure the status column is correctly referenced in the script

Delay in message sending

Rate limits

Add Utilities.sleep(1000) delay between messages

 

Security and Privacy Considerations

  • Use your own MySmsMantra API key and do not share it publicly.
  • Store sensitive data (like phone numbers) securely in Google Drive.
  • Only send messages to opt-in users to comply with WhatsApp policies.
  • Monitor your API usage through the MySmsMantra dashboard.

 

Conclusion

Integrating MySmsMantra WhatsApp Business API with Google Spreadsheet gives you a simple yet powerful way to automate communication. Whether you’re running a startup, school, travel agency, or e-commerce store, this setup allows you to manage and send personalized WhatsApp messages right from your familiar spreadsheet interface.

With just a few lines of code, you can convert your Google Sheet into a fully automated WhatsApp messaging tool — saving hours of manual effort and ensuring instant customer engagement.

So, why wait?
Log in to MySmsMantra.com, generate your API key, connect it to your Google Sheet, and start sending WhatsApp messages smarter and faster than ever before.

 

FAQs

Q1. Can I send images or documents using this setup?
Yes. MySmsMantra API supports media messages (images, PDFs, videos). You just need to modify the payload to include media URLs.

Q2. Do I need coding experience to set this up?
No. The script provided above is beginner-friendly and can be copied directly into Google Apps Script.

Q3. Is there a limit on the number of WhatsApp messages I can send?
Message limits depend on your MySmsMantra WhatsApp Business API plan. Contact their support for high-volume messaging options.

Q4. Can I schedule WhatsApp messages?
Yes. You can set time-based triggers in Google Apps Script to send scheduled or automated messages.

Q5. Is this integration secure?
Absolutely. MySmsMantra uses HTTPS-secured API communication. Just make sure you keep your API key private.

 


Comments