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.
- Create a free account at Make (Integromat).
- Create a new script. Select the application Google Sheets.
- Select the trigger: "Watch Rows" (Monitor added lines) or "Watch Changes" (Monitor changes).
- Connect the module to your Google account and select your file.
- Add a HTTP (Make a Request) module.
- Configure the call to the EnvoiSMS API (
POST https://api.envoisms.ma/v1/messages). - In the
tofield, 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.
- In your Google Sheets, click on ‘Extensions’ > ‘Apps Script’.
- Remove everything, and paste this script (change your API key):
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é");
}
}
}- Click on the “Execute” button.
- *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.
Frequently asked questions
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.