Sending bulk email using sendgrid

Posted 7 months ago by Deekshith

Hi Guys, Please help me,

I have a user management application and there are around 15k users registered on our website. and this application has a simple blog module 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'); });

}

Please sign in or create an account to participate in this conversation.