---
tags: [vompay, notification]
module: VomPay
---

# [Notification]Notifications

## Connections
[[_VomPay]] · [[[Service]SupplierServices]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/VomPay/Notifications/`

---

## NotifySupplierStatusService

Orchestrator — not a notification class itself. Retrieves users with `vompay.dashboard.view` permission via `RetrievingUsersByPermissionService`, then dispatches the appropriate notification.

| Method | Purpose |
|---|---|
| execute($status) | Routes to approval or rejection based on webhook status |
| notifyApproval($users) | Sends `NotifySupplierApproval` to each authorized user |
| notifyRejection($users) | Sends `NotifySupplierRejection` to each authorized user |

---

## NotifySupplierApproval
**Channel:** `database`  
Stores: `type` + optional `item_reference`  
Sent when MyFatoorah approves the supplier.

### NotifySupplierApprovalContentGenerator
Extends `ContentGenerator` (CompanyUser module).  
`canHandleNotification()` — matches `Modules\VomPay\Notifications\NotifySupplierApproval`  
`getContent()` — `vompay::vompay.notifications.supplierApproval`

---

## NotifySupplierRejection
**Channel:** `database`  
Stores: `type` + optional `item_reference`  
Sent when MyFatoorah rejects the supplier.

### NotifySupplierRejectionContentGenerator
Extends `ContentGenerator` (CompanyUser module).  
`canHandleNotification()` — matches `Modules\VomPay\Notifications\NotifySupplierRejection`  
`getContent()` — `vompay::notifications.supplierRejection`

---

## Email Notifications (via VomPayMailable trait)

`Modules/VomPay/Traits/VomPayMailable.php` — mixed into `VomPaySupplierService`, `VomPaySupplierStatusService`, `VomPayEmailTrackerService`.

| Method | Trigger | View |
|---|---|---|
| sendActivationEmails($myFatoorahId) | After `activate()` | `emails/activation-email` |
| sendApprovalEmail($to, $supplierName) | On APPROVED webhook | `emails/approval-email` |
| sendRejectionEmail($to, $supplierName, $reasons) | On REJECTED webhook | `emails/rejection-email` |
| sendTrackingEmail($request, $userInfo, $companyInfo) | Each registration step (1–3) | `emails/tracking-email` |

All emails dispatched via `SendingEmailService`.
