1

I have created a new file in resources/views/vendor/mail/html/coupon.blade.php and in resources/views/vendor/mail/markdown/coupon.blade.php

also in config/mail.php, I changed the configuration to this.

'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],

But still I am not able to use

@component('mail::coupon')

in my email blade file. its throwing following error.

Facade/Ignition/Exceptions/ViewException with message 'View [coupon] not found.
Jigar
  • 3,055
  • 1
  • 32
  • 51

3 Answers3

5

Still, I am not able to use like @component('mail::coupon') but I find out workaround to use like this @component('vendor.mail.markdown.coupon') to specify email template file.

Jigar
  • 3,055
  • 1
  • 32
  • 51
5

I had the same problem and for me the issue was, that just the component as text was missing. Both files are required

So if you have: resources/views/vendor/mail/html/coupon.blade.php

you also need: resources/views/vendor/mail/text/coupon.blade.php

See https://stackoverflow.com/a/68095965/936284 to check, how I created a new component mail::buttons

Alexander Taubenkorb
  • 3,031
  • 2
  • 28
  • 30
0

try this way:

resources/views/mail/html/coupon.blade.php 

resources/views/mail/markdown/coupon.blade.php

skip vendor directory

aziz
  • 1
  • 2
  • did you read this? https://laravel.com/docs/7.x/mail#markdown-mailables and https://laravel.com/docs/7.x/mail#writing-markdown-messages – aziz Sep 09 '20 at 06:17
  • also see here https://stackoverflow.com/questions/42724118/laravel-5-4-how-to-customize-notification-email-layout – aziz Sep 09 '20 at 06:20