feat: send WhatsApp notification on GRN confirmed
This commit is contained in:
1 parent
358907bbed
commit
639282f707
2 files changed
+33
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications\Purchase;
|
||||
|
||||
use App\Models\GoodsReceiptNote;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use PromoSeven\UltraMessage\UltraMessageChannel;
|
||||
use PromoSeven\UltraMessage\UltraMessageMessage;
|
||||
|
||||
class GoodsReceiptConfirmedNotification extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(private GoodsReceiptNote $grn) {}
|
||||
|
||||
public function via(mixed $notifiable): array
|
||||
{
|
||||
return [UltraMessageChannel::class];
|
||||
}
|
||||
|
||||
public function toUltraMessage(mixed $notifiable): UltraMessageMessage
|
||||
{
|
||||
return UltraMessageMessage::text(
|
||||
"GRN *#{$this->grn->grn_number}* has been confirmed and goods received.\n\nPO Reference: {$this->grn->purchaseOrder->po_number}\nDate: {$this->grn->received_date}"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user