Have a look at the Job Events
You can use the after method to send the email once your upload is complete.
Hi,
I have a situation where I need to upload huge data from csv file to database. I've managed to write a Job for processing the upload in the background using Queue. But I need to send a mail ( or even better, display a notification ) once the process has been completed. Please find below my Job for processing the upload ,
public function handle()
{
// Receive uploadedSheets from dispatcher
// and process the uploads
foreach($this->uploadedSheets as $sheetData)
{
//
$tz = new Timezone();
if(!empty($sheetData->timezone))
{
$tz->name = $sheetData->timezone;
}
$tz->status = true;
$tz->save();
}
Mail::to("[email protected]")->send(new TimezoneImported);
}
The Mail method I've used here didn't work and I'm noob to Events too. Please explain if possible how to fire an event to display notification in the front-end or send a mail to user once upload is completed. Thank you.
Please or to participate in this conversation.