SendLoanReminderJob
class SendLoanReminderJob implements ShouldQueue (View source)
Job responsible for sending a loan reminder email.
This queued job sends an email to remind the user that the loan due date is approaching. By delegating this task to the EmailService, we ensure asynchronous processing, avoiding delays in the HTTP request and improving user experience.
Traits
Dispatchable
InteractsWithQueue
Queueable
SerializesModels
Properties
| protected string | $loanId | The unique identifier of the loan, used to fetch the necessary data. |
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 reminder email.
This method retrieves the loan data based on the provided loan ID and triggers the email service to send the reminder to the user.