マイコード:laravelの電子メールレイアウトでイメージを表示するにはどうすればよいですか?このように電子メールを送信する
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Test')
->markdown('vendor.mail.markdown.message', ['data' => $this->data]);
}
このような私のmessage.bladeビュー:
@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
{{ config('app.name') }}
@endcomponent
@endslot
{{-- Body --}}
This is your logo
![Some option text][logo]
[logo]: {{asset('img/my-logo.png')}} "Logo"
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
@endcomponent
@endslot
@endcomponent
それは成功電子メールを送信するが、このような電子メールを含める:
This is your logo
![Some option text][logo]
[logo]: http://myshop.dev/img/my-logo.png "Logo"
画像が表示されない
どうすればこの問題を解決できますか?
私はこのリファレンスに従ってください:https://medium.com/@adnanxteam/how-to-customize-laravel-5-4-notification-email-templates-header-and-footer-158b1c7cc1c
Laravel文書は、それが画像用の電子メールコンポーネントを持っていないことを示しています。あなたはおそらくあなた自身を作る必要があります。 –
@Stuart Murphy、どういう意味ですか?より詳細に答えてみてください –
あなたは地元からのメールをお送りしていますか? –