Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
add ultraFastSend method
Browse files Browse the repository at this point in the history
now you can send any message with approved template to any person and phone number with ultraFastSend() method
  • Loading branch information
TrueMoein committed Nov 7, 2017
1 parent 6c7b71b commit e144dd1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Smsir.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,24 @@ public static function sendVerification($code,$number,$log = false)
return json_decode($result->getBody(),true);
}

/**
* @param array $parameters = all parameters and parameters value as an array
* @param $template_id = you must create a template in sms.ir and put your template id here
* @param $number = phone number
* @return mixed = the result
*/
public static function ultraFastSend(array $parameters, $template_id, $number) {
$params = [];
foreach ($parameters as $key => $value) {
$params[] = ['Parameter' => $key, 'ParameterValue' => $value];
}
$client = new Client();
$body = ['ParameterArray' => $params,'TemplateId' => $template_id,'Mobile' => $number];
$result = $client->post('http://restfulsms.com/api/UltraFastSend',['json'=>$body,'headers'=>['x-sms-ir-secure-token'=>self::getToken()],'connect_timeout'=>30]);

return json_decode($result->getBody(),true);
}

/**
* this method used for fetch received messages
*
Expand Down

0 comments on commit e144dd1

Please sign in to comment.