0
votes

I am sending 2 emails to the user, one when he registers and one when he requests to reset his password (forgot password functionality). The code is similar for both of the above mentioned functions. However, email is getting sent successfully whenever a user registers a new account, whereas I am getting View [] not found (View:/home/vagrant/Laravel/youtube/resources/views/emails/password/reset.blade.php) error. Similar code, just changed the file name and some backend logic.

Here's the code where the mail is being sent (Mail Class)

public function build() {
        return $this->subject('Reset your password')
                    ->markdown('emails.password.reset')
                    ->text('emails.password.reset_text');
    }

Here's the markdown file emails/password/reset.blade.php

@component('mail::message')
<strong>Hello {{ $token->user->getFirstNameOrUserName() }}!</strong>

You are receiving this email because we received a password reset request for your account.
If you did not request a password reset, no further action is required.

@component('mail::button', [
    'url' => route('password.reset', ['token' => $token,]) . '?email=' . urlencode($token->user->email)
])
Reset Password
@endcomponent

Thanks,<br>
{{ config('app.name') }}
@endcomponent

<hr>
If you’re having trouble clicking the <strong>"Reset Password"</strong> button, copy and paste the URL below into your web browser:<br>
<small>{{ route('password.reset', ['token' => $token,]) . '?email=' . urlencode($token->user->email) }}</small>

@endcomponent

I am getting View [] not found. (View: /home/vagrant/Laravel/youtube/resources/views/emails/password/reset.blade.php)

Don't really know why. I guess, I need a second pair of eyes to find out the mistake.

1

1 Answers

1
votes

I found the answer, For whatever reason I had closed(ended) the markdown component twice @endcomponent in my markdown template.