vendredi 29 juin 2018

Laravel: Sending Mail with Queue ignores Locale

My Email template looks like this:

@component('mail::message')
# 

@lang('welcome.message')

This

\App::setLocale('de);

$activeMail =  new \App\Mail\Register\Activate($user);

\Mail::to($user)->send($activeMail);

will send an mail with German text.

However, when I use a queue

\App::setLocale('de);

$activeMail =  new \App\Mail\Register\Activate($user);

\Mail::to($user)->queue($activeMail);

The mail is send in English, which is the default language of my app. How can I send a message in German with the queue without changing the default language?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire