SendLoanReceiptJob
class SendLoanReceiptJob implements ShouldQueue (View source)
Job responsible for sending a loan receipt email asynchronously.
This job sends a confirmation receipt to the borrower after a loan is created. By queuing this task, the system ensures the user's workflow is not delayed, providing a faster response time while the email is processed in the background.
Traits
Dispatchable
InteractsWithQueue
Queueable
SerializesModels
Properties
| protected string | $loanId | The unique identifier of the loan, used to fetch the necessary data for the receipt. |
Methods
__construct(string $loanId)
Create a new job instance.
void
Details
__construct(string $loanId)
Create a new job instance.
void
handle(EmailService $emailService)
Execute the job to send the loan receipt email.
This method fetches the loan from the database using its binary UUID and passes it to the EmailService for sending the loan receipt email.