Integrating services like WhatsApp for notifications and messages within Moodle can significantly enhance the learning experience as message can be sent to whats app and user can intiate conversation from there.
There are 2 parts in this post
1- Whatsapp Service Provider for API
2- Moodle integration
Whatsapp service provider
Under this, there are mainly 2 options to chooes
1- Using WhatsApp’s Official Cloud API
WhatsApp provides a cloud-based API solution (via the Meta Business Platform), which reduces the complexity of hosting and maintaining the server infrastructure.
- Go to the WhatsApp Business API Cloud page to get started.
- Set up your environment by linking your WhatsApp Business Account and phone number.
- Use the API Key provided by WhatsApp to authenticate requests.
Signing up for whatsapp is a lengthy and time taking process [2-6 weeks] which involves
1- facebook business signup and business verification process , that may take weeks
2- using whatsapp manager to verify phone number that will be used for api and that number should not be used already on whatsapp along with that adding payment information and whatsapp template approval
3- creating an app on https://developers.facebook.com/ that will be used to make the API call
2- Using third party providers
Using Twilio /gupshup or other as provider that allows businesses to send WhatsApp messages via their API. Other options like MessageBird or 360Dialog can also be used.
2- Moodle Integration
I have create a moodle local plugin that can help in sending the message and verifiy the phone .
My Whatsapp Moodle Plugin
Before sending WhatsApp messages, you must verify that the phone number associated with the user in Moodle is valid. This is essential for ensuring messages are sent to the right contact.
My Whatsapp plugin setting page to control various functionality
Phone Number Verification
Here is the way to verify phone numbers in Moodle using whatsapp OTP through my plugin
- Enable the OTP functionality so that users must enter a code sent to their phone to verify their number. Once user login, they will be asked to fill the PHONE2 field in their user profile and whenever they change the phone2 value , they will be asked again to verify the number
Sending Message to verified number
whenever a message is sent to user, if functioanlity enabled and user has verfied number it will also send the message to whatsapp number
Now the catch is, whatsapp does not allow to send message to user if user has not did the conversation. To overcome this , we will use whatsapp template feature , where we are creating the template with one variable so that message can be sent.
Log Report
All the logs will be recorded and report is available under admin report section
Connect over email to get more detail about this integration.