How to Integrate SMS in Marg Software

 Hi Reader,




After a long interval I am with you.  In today session iam going to tell you how to match DLT template with your SMS  before actual sending. Its help your to save your SMS balance to distroy. 

This blog is targeted for MARG Software where there is no option to add DLT ID of SMS but DLT id mendatory to send any SMS now a day. 

I am Sharing some tricks and function which is written in  PHP its help you to find the DLT template id based on your SMS Content. 

STEP 1. Go to any SMS Portal and Create a Valid Account and Buy Some Balance.

STEP 2. Activate the SMS in Marg As Suggest in Marg Tutorial or Documentation.

STEP 3. Send SMS from Marg on Diffrent Events like Payment Recive, New Bill, Modify Bill, Bill Cancellation, Ledger Balance etc.

STEP 4. Copy All Failed SMS Form Delivery Report and Replace all Data Part with {#var#} .

Example : "{#var#} No. {#var#} Dt: {#var#} Amount: {#var#} Balance: {#var#} ";

STEP 5.  Now the SMS Template is Ready go to any DLT Portal and Apply for Approval with Your Signature ( Company/ Organization) Name. 

example :  "{#var#} No. {#var#} Dt: {#var#} Amount: {#var#} Balance: {#var#} THANK YOU. GOLDIEE GROUP";

STEP 6. Now Actual Part Start from Here. You required the PHP Server to Send SMS on This to receive the MARG SMS and Find the Corresponding TemplateID 

FUNCTION TO CHECK SMS IS VALID OF NOT 

function temp_match($template, $msg)

{

$temp_arr = explode("{#var#}", $template);

//print_r($temp_arr);

foreach($temp_arr as $temp)

{

$temp=str_replace("\r\n","",$temp);

$msg=str_replace("\r\n","",$msg);

if (str_contains(strtolower($msg), strtolower($temp) )) 

$st= "SUCCESS";

}

else{

$st= "ERROR " . $temp;

break;

}

}

return $st;

}

Here Template and msg is STRING .

function template_search($msg)

{

    global $sms;

    foreach($sms as $template_id => $template)

    {

    $status = temp_match($template, $msg);

    $st='NA';

    if( $status =="SUCCESS")

    {

    $st = $template_id;

    break;

    }

    }

    return $st;

}

Here SMS is Array which contains all approved template list .

Recived SMS and Mobile Number and Forward to Actucal Send 

$mobile =$_GET['mobile'];

$msg =$_GET['msg'];

$dlt_id  = template_search($msg);

if($st !='NA')

{

echo send_sms($mobile,$msg,$dlt_id);

}

else{

    echo "SMS NOT SENT TEMPLATE MISMATCHED";

}

Always Verify The Refral Server Link for Minify the Unauthorised Uses

if Any Issue Kinldy Comment Us or Mail ask@offerplant.com

Comments