update marketing
All checks were successful
All checks were successful
This commit is contained in:
21
Modules/MarketingAddon/App/SmsGateways/HaDavar.php
Normal file
21
Modules/MarketingAddon/App/SmsGateways/HaDavar.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MarketingAddon\App\SmsGateways;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class HaDavar
|
||||
{
|
||||
public static function send_message($gateway, $numbers, $contents, $sender_name = null)
|
||||
{
|
||||
$response = Http::asForm()->{$gateway->params['api_method']}($gateway->params['api_url'], array_merge([
|
||||
'Username' => $gateway->params['username'],
|
||||
'Token' => $gateway->params['token'],
|
||||
'Sender' => $sender_name ?? $gateway->params['sender'],
|
||||
$gateway->params['number_key'] => $numbers,
|
||||
$gateway->params['message_key'] => $contents,
|
||||
]));
|
||||
|
||||
return $response->body();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user