I'm using laravel 5.1. AWS EC2 service, ubuntu OS.
I've created a command that sends emails to a number of users. Lets say I have this sample code:
foreach($users as $user) {
$data = $user->toArray();
$data['subject'] = "This is subject";
Mail::queue('emails.email_content', $data, function ($message) use ($data) {
$message->subject($data['subject']);
$message->to($data['email']);
});
}
In email_content.blade.php
lets say I have this code
Hi {{ $first_name . ' ' . $last_name }}
I used beanstalkd as my queue driver. And use supervisor for monitoring. In my .env file I have this:
CACHE_DRIVER=file
SESSION_DRIVER=database
QUEUE_DRIVER=beanstalkd
But some users are complaining that they're receiving the wrong emails because the name is wrong, sometimes even the subject is wrong. And I'm sure getting the correct $users
. What am I doing wrong here? Is it possible that the email are cached or something like that?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire