2017-08-14 17 views
0

HTMLをレンダリングし、私はこのコードの通知を持っている:Laravel 5.4はMailMessage ::アクションは()間違って

public function toMail($notifiable) 
{ 
    return (new MailMessage) 
    ->subject("Welcome to My App") 
    ->greeting('Welcome to My App') 
    ->line('Hello, ' . $notifiable->name) 
    ->line('You have been registered to My App.') 
    ->line('Please do change your temporary password upon your login.') 
    ->line('Your email: ' . $notifiable->email) 
    ->line('Your temporary password: ' . $this->password) 
    ->action('Login to My App', url('/')); 
} 

メールを受信すると、それは間違ってレンダリングしているようですし、アクションによって生成されたHTML()メソッド間違っている。

は、Gmailのレンダリング: enter image description here 私はMailtrapを経由してメールのHTMLを検査する場合、これはソースです:

enter image description here

あなたが見ることができるように、特殊なHTML文字をHTMLエンティティになりました。

composer update経由でLaravelを更新しようとしましたが、問題を解決できませんでした。

答えて

0

わかりました。私はphp artisan vendor:publish --tag=laravel-notificationsを実行した後、私の/resources/views/vendor/notifications/email.blade.phpファイルを編集しました。

私はそのテンプレートのアラインメントを設定しようとしましたが、これはメールテンプレートを正しくレンダリングしませんでした。

関連する問題