Hi Guys, Please help me,
I have a user management application and i have around 15k users registered on our website. and we have a simple blog application designed using laravel and I want to send email to all registered users once i post any updates in the blog. I am using sendgrid for this, but whenever I tried to send email, it is taking too much time in a loop and sometimes it gives timeout error. is there any way I can achieve this at high speed? and I need to hide all recipients email address. i know by using bcc we can hide all emails but need clarification regarding this.
Here is the sample code:
//converted email array to chunks
$recipient_chunks = array_chunk($email_array, 999);
//loop over user email address
foreach ($recipient_chunks as $user) {
Mail::queue('emails.updates_template',$email_data,function($message) use($email_data,$user) { $message->bcc($user)->subject('Latest Updates');
});
}