How To Send WhatsApp Messages With A Google Sheets Function

How To Send WhatsApp Messages With A Google Sheets Function

The first 1,000 monthly messages are generously offered by WhatsApp Business Account for free. The cost is then determined by the receiver and sender countries and is based on a pay-per-use model after that.

WhatsApp API Pricing:

To further understand, let’s examine the pricing for the WhatsApp API. For instance, it would cost 14 to send a WhatsApp message from a US phone number to a user in France. However, the cost would be around 0.006 per message if you sent them from an Indian WhatsApp phone to another Indian number. via WhatsApp’s official website, you may see the rate cards for their pricing via the API.

Using the WhatsApp Business API necessitates your company to be authenticated on Facebook, and there are particular verification requirements in addition to the cost consideration. In accordance with the conditions, you should only send messages to WhatsApp users who have voluntarily chosen to receive messages from you in the future.

The fact that you can only send messages based on templates that WhatsApp has already authorized is a significant restriction of the WhatsApp API. Within 24 hours of the final user message in a chat, you are permitted to send free-form messages.

WhatsApp Function for Google Sheets:

Here is a great semi-automated option if you are a small business looking for an alternative way to message consumers on WhatsApp without paying API fees. You can use WhatsApp’s Click to Chat feature, which enables you to send customised messages to any registered phone number fast.

Let’s investigate how Google Sheets handles this. Imagine you have a document with the names of your clients, the amount they owe, and the payment deadline. You can construct a unique message for each customer in column D by using Google Sheets’ CONCATENATE or TEXTJOIN function.

You may find the phone numbers of your WhatsApp users in column E of the Google Sheet. The fun part now: using the WHATSAPP custom function, you can create a unique chat link for each client in the Google Sheet. When you click on this chat link, a WhatsApp conversation with the user is immediately started and the message is already typed into the chat box.

WhatsApp Function:

You might be unsure of how to operate Google Sheets’ WhatsApp feature. It’s quite simple to understand! The function that creates the Click to Chat link is shown below, and it also works with array formulas:

/**
 * Create WhatsApp Click to Chat Link
 *
 * @param {string} phone The phone number with the country code
 * @param {string} message The text message
 * @param {boolean} web Open the message in WhatsApp web?
 * @return The pre-filled message link for WhatsApp.
 * @customfunction
 */
function WHATSAPP(phone, message, web) {
  if (Array.isArray(phone)) {
    return phone.map((row, index) => WHATSAPP(row[0], message[index][0]), web);
  }
  const phoneNumber = String(phone).replace(/[^\d]/g, '');
  const messageText = encodeURIComponent(message);
  return web === true
    ? `https://web.whatsapp.com/send?phone=${phoneNumber}&text=${messageText}`
    : `https://wa.me/${phoneNumber}?text=${messageText}`;
}

You can choose whether the link should open the WhatsApp desktop app or the website using this flexible feature. Use the attached live sheet to explore with it.

In conclusion, WhatsApp Business Account provides a practical answer to your messaging requirements, and with innovative tools like the Click to Chat function, you can effectively interact with your clients without incurring any extra costs. Cheers to WhatsApping!

Leave a Comment