2017-08-14 58 views
0

我有此代碼通知:Laravel MAILMESSAGE 5.4 ::動作()呈現HTML錯誤

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文件。

我試圖設置該模板上的路線,反過來使電子郵件模板渲染不正確。