In today’s digitalized business solution world, SMS notifications are one of the fastest ways to reach users. Whether it’s for OTP (One-Time Password), reminders, or alerts, integrating SMS with your Oracle APEX application can add huge value. In this guide, we’ll walk through different ways to send SMS from Oracle APEX. For better understand follow this Tutorial in Youtube.
Why Send SMS from Oracle APEX?
Oracle APEX already provides built-in features for sending emails, but sometimes email isn’t enough. SMS can be useful for:
-
OTP & Two-factor Authentication
-
Order Confirmations Text
-
Notifications
-
Promotional Messages
Process to Send SMS in Oracle APEX
1. Register with Third Party SMS Gateway
Most SMS providers (like Twilio, Nexmo, or local telecom gateways) expose a REST API to send SMS. Oracle APEX supports REST integrations, so you can call these APIs directly.
Steps:
-
Choose an SMS provider (e.g., Twilio, Nexmo, Clickatell, or your local telecom).
-
Get your API credentials (API Key, SID, Auth Token, etc.).
2. Create Application Page To Send SMS
In this step you need to create a page to send SMS from your application. In my case, I have try to shown in two ways to send SMS. First, try to send SMS to a single receiver. And lastly shown how to send SMS to multiple users at a time.
3. Create AJAX Callback Process to Prepare Mobile No. Lists of Receivers
Select process tab on the left side navigation pane and follow the below process-
1. select AJAX Callback.
2. Right Click here and select Create Process.
3. Paste the below code Source > PL/SQL Code in properties section-
BEGIN
apex_json.open_array;
FOR I IN (
SELECT last_name
, phone_number
, ‘Dear ‘||last_name||’, ‘||chr(10)||’Your salary is BDT‘||salary||’ transferred to your bank.’||chr(10)||’Thank You’||chr(10)||’Payroll Section’ AS MSG
FROM employees
WHERE INSTR(‘:’||REPLACE(apex_application.g_x01,’,’,’:’)||’:’,’:’||employee_id||’:’) > 0
) LOOP
apex_json.open_object;
apex_json.write(‘NAME’, i.last_name);
apex_json.write(‘MOBILE’, i.phone_number);
apex_json.write(‘MSG’, i.msg);
apex_json.close_object;
END LOOP;
apex_json.close_all;
END;
Note: Please replace appropriate single code in your pl/sql code editor.
4. Create Javascript Function to Execute AJAX Callback Process
5. Create Dynamic Action to SEND_SMS button
Set the below properties for that dynamic action-
var arr = [] ;
Conclusion
Sending SMS from Oracle APEX is straightforward if you use an SMS Gateway API like Twilio, Nexmo, or your local provider. By leveraging AJAX callback process and javascript function, you can easily send OTPs, alerts, and notifications from your APEX applications.
Start small with a test SMS, then integrate it into your workflows—your users will appreciate the instant updates!
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
Comments
Great content. Please keep it up.
ReplyDelete