-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(new MailMessage)->view("email.test")->render() throws "View [] not found" error #28958
Comments
I think it's best that in this case you just use the Laravel framework which was intended to work with these components and not Lumen. Lumen is only intended for highly scalable apis. In any case if you're facing an integration problem with any of the components it's best that you ask on a support channel. Thanks. |
Alright. Thanks @driesvints. |
Hi, I am facing the mentioned issue in Laravel framework's Notification. I have tried on fresh Laravel's copy and still facing same exception.
And in toMail() method I am returning like below:
Facing below exception:
|
@awebartisan Yes, I can confirm that. I bootstrapped a new project ( - return (new MailMessage)->view('dummy');
+ return (new MailMessage)->markdown('dummy'); The issue is with the @driesvints Can you please look into it ? I am happy to create a fix PR. |
Can you upload a repo to github which reproduces the problem? |
@sudkumar there's no "dummy" view in your repo: https://github.com/sudkumar/notification_render_issue_in_laravel/tree/master/resources/views Please try a support channel. Thanks. |
I am using the |
@sudkumar can you please try a support channel first? If you can actually confirm the bug feel free to respond back. |
Thank you. No problem. :) |
maybe you can check here, already fixed in #29698 |
@muhtarudinsiregar Thank you for the reference. I was sure of the bug as it was clear from the code itself and now it is fixed. 🍻 |
Description:
In my lumen based project, I am using
illuminate/notifications
andilluminate/mail
package to set the notification emails. Before sending notification, I want to preview the rendered content of notification.I am previewing Mail Notifications by calling the
(new MailMessage())->view("emails.testing_template")->render()
from a testing route. When accessing the route, I got an error statingView [] not found.
Steps To Reproduce:
composer require illuminate/mail illuminate/notifications
Instead of getting,
We will get an error stating
Possible Solution
After digging into the error message, I found that
framework/src/Illuminate/Notifications/Messages/MailMessage.php
Lines 290 to 295 in 1d8ec9a
the render method only respects the
$this->markdown
, which in my case, is not even set.There are two possible solutions
markdown
instead ofviews
.This will require no change in the library. But I don't know if it is what is expected by the apis. May be docs should mention it somewhere. As far as I know, Markdown is a super set of Views so any view should just work for markdowns. Please correct me if I am wrong!.
render
method to consider the$this->view
along with the$this->markdown
The text was updated successfully, but these errors were encountered: