Expertise technical

Send SMS from Google Sheets to Morocco without writing a line of code

Send SMS to Google Sheets without coding: Technical guide with code examples for developers in Morocco.

Send SMS from Google Sheets to Morocco without writing a line of code
Table of Contents
  1. The reality of Moroccan SMEs (real estate agencies, insurance brokers, medical firms) is that the main “CRM” is often a simple Google Sheets table.
  2. Why Google Sheets remains the preferred tool of Moroccan SMEs
  3. Method 1: No code (via Make or Zapier)
  4. Method 2: With Apps Script (Zero external subscription, a little copy-paste)
  5. The concrete use case: Reload unpaid at the end of the month

The reality of Moroccan SMEs (real estate agencies, insurance brokers, medical firms) is that the main “CRM” is often a simple Google Sheets table.

When you have a list of 500 contacts in your Google Sheets (Name, Phone, Status), copy and paste numbers one by one into your phone to send a payment reminder or an invitation is a long-lasting nightmare. Automation is possible. Here are two methods to link your Sheets file to the EnvoiSMS API, depending on your technical level.

Why Google Sheets remains the preferred tool of Moroccan SMEs

The flexibility of Sheets is unbeatable. A doctor can have a "Meet" column and a "Number" column. A real estate agent can have a "Date of visit" column. The goal is simple: "If I write 'Yes' in column E, an automatic SMS must start on the person's phone (Column B)".

Method 1: No code (via Make or Zapier)

This is the visual method, ideal for non-developers.

  1. Create a free account at Make (Integromat).
  2. Create a new script. Select the application Google Sheets.
  3. Select the trigger: "Watch Rows" (Monitor added lines) or "Watch Changes" (Monitor changes).
  4. Connect the module to your Google account and select your file.
  5. Add a HTTP (Make a Request) module.
  6. Configure the call to the EnvoiSMS API (POST https://api.envoisms.ma/v1/messages).
  7. In the to field, drag the bubble corresponding to your 'Telephone' column. In the 'message' field, drag the 'Name' column to customize: Hello {{Name}}, your appointment is confirmed.

Resultat: Every time you add a line to your Excel table, a text message is sent to the client.

Method 2: With Apps Script (Zero external subscription, a little copy-paste)

Google Sheets has a hidden programming language (Google Apps Script). If you do a simple copy-paste of this code, you will not have to pay Make or Zapier.

  1. In your Google Sheets, click on ‘Extensions’ > ‘Apps Script’.
  2. Remove everything, and paste this script (change your API key):
javascript
function envoyerSMS() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var startRow = 2; // On commence à la ligne 2 pour éviter l'en-tête
  var numRows = sheet.getLastRow() - 1; 
  var dataRange = sheet.getRange(startRow, 1, numRows, 3); // Colonne A=Nom, B=Tel, C=Statut SMS
  var data = dataRange.getValues();
  
  var apiKey = "VOTRE_CLE_API_ENVOISMS";
  var url = "https://api.envoisms.ma/v1/messages";

  for (var i = 0; i < data.length; ++i) {
    var row = data[i];
    var nom = row[0];
    var tel = row[1];
    var statut = row[2];

    // On n'envoie le SMS que si la colonne Statut est vide
    if (statut !== "Envoyé" && tel) {
      var message = "Bonjour " + nom + ", nous vous rappelons votre rendez-vous demain. L'équipe du Cabinet XYZ.";
      
      var payload = {
        "to": tel,
        "from": "CABINET_XYZ",
        "message": message
      };
      
      var options = {
        "method": "post",
        "headers": {
          "Authorization": "Bearer " + apiKey,
          "Content-Type": "application/json"
        },
        "payload": JSON.stringify(payload)
      };
      
      // Appel de l'API
      UrlFetchApp.fetch(url, options);
      
      // Marquer la cellule comme envoyée pour ne pas renvoyer le SMS demain
      sheet.getRange(startRow + i, 3).setValue("Envoyé");
    }
  }
}
  1. Click on the “Execute” button.
  2. *Magic: The script will read your file, send the SMS via the local Moroccan API, and write "Send" in column C for each processed client.

The concrete use case: Reload unpaid at the end of the month

With this system, the recovery of invoices or transactions (unpaid) takes 5 seconds. The SME accountant filters its Google Sheets table on customers "Late", clicks on its "Execute" button, and 200 SMS leave simultaneously (with the official Sender ID of the company). The manual effort is removed, and the SMS credit bill is profitable from the first settlement recovered.

Why choose EnvoiSMS for your business?

Carrier Delivery

Local routes to IAM, Orange and Inwi, with automatic failover between routes and delivery status sent by webhook.

Cost Optimization

WhatsApp Business API from 0.65 MAD per message with optimal ROI.

Sovereign Data (CNDP)

Full compliance with Moroccan personal data protection regulations (CNDP).

How do I track routing on the IAM, Inwi and Orange networks?
Our local routes to Maroc Telecom (IAM), Orange and inwi, with automatic failover between routes, return a carrier delivery status for every message, by webhook. Delivery time depends on the recipient's carrier and network.
How does the platform manage the format of Moroccan numbers?
EnvoiSMS automatically normalizes the numbers entered (06..., 07..., 00212...) to the E.164 standard (+212) to avoid any delivery failure.

Suggested Articles

SMS Formatting in Morocco: Line Breaks, GSM-7 vs UCS-2 Encoding and Cost Optimization
technical

SMS Formatting in Morocco: Line Breaks, GSM-7 vs UCS-2 Encoding and Cost Optimization

WhatsApp Business Formatting in Morocco: Enriched Text, Emojis and Interactive Buttons
technical

WhatsApp Business Formatting in Morocco: Enriched Text, Emojis and Interactive Buttons

One-Tap Autofill & 1-Click WhatsApp OTP Authentication in Morocco
technical

One-Tap Autofill & 1-Click WhatsApp OTP Authentication in Morocco