mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 08:01:06 +03:30
add rahyab notification service
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Notification;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class SendSmsToAdmins
|
||||
{
|
||||
protected array $mobiles;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->mobiles = [
|
||||
"09101526570",
|
||||
"09128529050"
|
||||
];
|
||||
}
|
||||
|
||||
public function sendRequestNotification($device_title, $smsUser)
|
||||
{
|
||||
$adminCollection = User::query()
|
||||
->orWhere('role', 'admin');
|
||||
|
||||
$adminText = "کاربر %s
|
||||
با شماره ی همراه %s
|
||||
درخواستی زیر را ثبت کرد\n
|
||||
%s\n";
|
||||
$adminText = sprintf($adminText, $smsUser->full_name, $smsUser->cell_number, $device_title);
|
||||
SmsNotification::to($adminCollection)->isSystematic()->send(
|
||||
$adminText,
|
||||
'service'
|
||||
);
|
||||
|
||||
|
||||
$userText = "%s عزیز\n
|
||||
درخواست شما را دریافت کردیم\n
|
||||
به زودی همکاران ما با شما تماس خواهند گرفت\n
|
||||
از اعتماد شما سپاسگزاریم\n";
|
||||
$userText = sprintf($userText, $smsUser->full_name);
|
||||
$userCollection = User::query()->where('id', $smsUser->id);
|
||||
$res = SmsNotification::to($userCollection)->isSystematic()->send(
|
||||
$userText,
|
||||
'service'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user