I have created a queue job to send an email to my batch of users it works fine when I send an email with an attachment. But when I add the file to queue I get an error that says unable to serialize content.
$emailJob = (new SendNewsletter($id, $request->flag, $attachments))->delay(Carbon::now()->addSeconds(3));
dispatch($emailJob);
You should not include your file in the job directly. Rather do something like this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.