mercredi 21 août 2019

Laravel queue email picks default MAIL_USERNAME

I have 2 different configurations to send out the email

  • One to send out the notifications
  • One to send out the system emails

I am sending a notification email from queues but when I receive the emails, it is being sent with wrong headers. e.g.

Configuration 1

MAIL_USERNAME="no-reply@serviceproviders.com"
MAIL_PASSWORD=my password here
MAIL_FROM_NAME="No Reply - Service Provider"

Configuration 2

MAIL_USERNAME_1="user@serviceproviders.com"
MAIL_PASSWORD_1=my password here
MAIL_FROM_NAME_1="User - Service Provider"

This is how I am sending out the emails

Mail::to($to)->cc($cc)->queue(new App\Mail\Mailable($template));

$email = $this->view('emails.users.welcome',$this->data)->subject($this->subject)->from(env('MAIL_USERNAME_1')), env('MAIL_FROM_NAME_1'));

Emails are being sent correctly but the problem is, I am getting the MAIL_USERNAME in email headers instead of MAIL_USERNAME_1

I have tried with php artisan config:cache, and also tried changing the names of environment variables but issue persists.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2MvBgQM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire