dimanche 27 novembre 2016

laravel 5.3 mailable and locale

Can't get to work L5.3 Mailable with current app locale. It always sends email with default instead of current locale.

E.g I have event listener which calls Mail:

 public function handle(Registered $event)
    {   
        dd(app()->getLocale());
        \Mail::to( $event->user->email )->queue( new EmailConfirmation() );
    }

dd returns me 'fr' locale, but email is sent in english (default app locale).

Email templates looks like this:

In case of en locale email should contain "Hello world", in case of fr locale - "Bonjour monde".

But i always get "Hello world".



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire