0

I have taken SMS service from http://bulksmsindia.mobi/bulksmsindia/index.html. I want to integrate SMS in my WordPress website as a confirmation form submission. I have got from the service provider below but how can I integrate please guide.

Bulk SMS India Developers API

HTTP API Details

Send SMS(Comma Seperated):

http://bulksmsindia.mobi/sendurlcomma.aspx?user=profileid&pwd=password&senderid=ABC&mobileno=9999999989,9999999990,9999999991&msgtext=Hello

Code Sample:(Send SMS)

''''write code for loop while (you can open record set here)
 sResponse = ""
 sResponse = SMSSend(pno, message )
 If right(sResponse,15) = "Send Successful" Then
 'write your code here
 End If
 '''End Wend
 Function SMSSend (strPh,strMsg)

 Dim msgResponse
 Dim strRequest
 Dim strUrl
 msgResponse = ""

 strPh=right(strPh,10)
 If not IsNumeric(strPh) Or len(strPh) <> 10 Then
 msgResponse = "Enter valid Mobile Number."
 End If
 If strMsg = "" Then
 msgResponse = "Enter text message."
 End If

 strUrl = "http://bulksmsindia.mobi/sendurlcomma.asp?"
 strRequest = strRequest+"&user=profileid"
 strRequest = strRequest+"&pwd=pass"
 strRequest = strRequest+"&senderid=senderid"
 strRequest = strRequest+"&mobileno="+strPh
 strRequest = strRequest+"&msgtext="+Server.URLEncode(strMsg)

 strUrl = strUrl+strRequest

 If msgResponse = "" Then
 Dim oXML
 Dim sPage
 Err.Clear
 On Error Resume Next
 Set oXML = Server.CreateObject("Msxml2.XMLHTTP")
 oXML.Open "get", strUrl , false
 oXML.Send
 msgResponse = oXML.ResponseText
 Set oXML = Nothing
 End If

 SMSSend = msgResponse

 If Err.Number <> 0 Then
 SMSSend = "Problem on sending sms : "& Err.Description
 End If

 End Function
1
  • Your sample code is just VBA to make a GET request to that URL, which you can do with wp_remote_get() in WordPress. I don't know CF7 well enough to tell you which action you should hook, nor can I see the hooks in the CF7 documentation (!) but here's a third-party list: hookr.io/plugins/contact-form-7/5.1.7/hooks
    – Rup
    Apr 13, 2020 at 16:23

1 Answer 1

0

The best way to integrate SMS into Contact Form 7 is to find an SMS provider that supports an email interface to send the SMS.

Then just tick Mail 2 at the bottom of the config form and you can put your message into that.

I've done this in the past with Kapow SMS gateway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.