Send Messages via WhatsApp

Some provider or developer has created a module to send messages via WhatsApp. appointments and reminders.?
Saludos
Luis

My SMS/Fax module is now in core for v7.0.1 and can be turned on in Modules. Supports Twilio SMS and allows reminders.

1 Like

Thanks for the answer @sjpadgett, I already knew your module. I have a client who wants WA :man_shrugging:

Here in Brazil we only use whatsapp

Looks like if someone wanted to use @sjpadgett’s module you could extend it to make this happen:

Probably a hack, but you could always try entering in the phone number for the from and to field using the whatsapp nomenclature and see if it works as it looks like that is how twilio uses it in the code.

whatsapp:+13233633791
1 Like

As a test user, send and receive SMS and WA, just by changing the phone number (Twilio and Sandbox).

<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once 'twilio/src/Twilio/autoload.php';

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
// export TWILIO_ACCOUNT_SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxfd"
// export TWILIO_AUTH_TOKEN="abaxxxxxxxxxxxxxxxxxxxx091f"

$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

// SMS Message
$message = $twilio->messages
                  ->create("+54XXXXXXXX40", // My Number
                           [
						   "from" => "+1XXXXXXXXXXX6", //Twilio Number
						   "body" => "SMS Message"
						   ]
                  );

print($message->sid);

// Whatsapp Message
$message = $twilio->messages
                  ->create("whatsapp:+54XXXXXXXX40", // My Number
                           [
						   "from" => "whatsapp:+1XXXXXXXXXXX6", //Sandbox Number
						   "body" => "Whatsapp Message"
						   ]
                  );

print($message->sid);

// ID and Token are the same.

@sjpadgett You already have your version 1.1 of your module (SMS, Fax and WA).
At least I’m going to try to modify it. Thank you for your work.
Saludos.
Luis.

I just went through my Twilio module and upgraded to support v7.0.1 and is in master branch to be released in April.
I highly recommend using it. It is now a core module and turned on in Modules menu.

I doubt I’ll update the existing current npm module to v7 but I may replace with the one from core for those on earlier versions of openemr.

2 Likes

Tank you so much @sjpadgett , but I get an message: " Not Authenticated or not authorised. Ensure valid credentials are setup from Activity menu.", I use these keys, for Twilio account sid I use Live Credential (tried with Test Credential): is it because I have a free account?

Is this what your account setup looks like?

Yes, yes.

Credentials should be fine. I don’t use the account Id/token(Basic Auth in header) as I only use the Account Id, API token and secret.

It’s been a couple years since I’ve created a new account or have used the test sandbox and perhaps I should try but I just never have an issue with Twilio setup though may be something new.

Twilio used to have error logs and alerts in Monitor. Check there to see if it is being recorded as failed auth.
Also if you want to email me your credentials I can check it out from my environment.
sjpadgett@gmail.com

Otherwise I’ll try out my test account and see if I have issues with it.

also check these settings

I think I’ll wait for the update Jerry, since I saw that you modified scripts from other directories and also I’m missing the Twilio SDK. Don’t worry, when the new version is ready I’ll try it immediately and let you know. Thank you

1 Like

We also need this integration with whatsapp

I think @sjpadgett can give you a solution from Twilio’s https://pages.twilio.com/. Otherwise I have a solution from Ultramsg Gateway de API do WhatsApp para envio de mensagens e chatbot - Ultramsg

1 Like

Hi Ederson Nascente,
You Can contact our support team for this integration They will help you.Contact mail id help@capminds.com

Thanks,
Param,
help@capminds.com

I have everything in place in my SMS module to support WhatsApp except adding to the dialog .
If someone was to make a small donation to openemr foundation I’d be willing to try to get in for our next patch.
By adding to our core module notifications would also be supported.

@sjpadgett Hello, my email is edersonnascente@gmail.com and whatsapp is +5551999426644, send me the information you need to inform the price.
My English is bad, sorry!

How much do you need to make this happen. I can donate.

Really need this feature for our clinic

Any update on this mission. It will be a very useful update