Skip to content
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

Embedding images fails #28

Open
dinamic opened this issue Dec 12, 2019 · 3 comments
Open

Embedding images fails #28

dinamic opened this issue Dec 12, 2019 · 3 comments

Comments

@dinamic
Copy link

dinamic commented Dec 12, 2019

Often times with email messages we want to embed the images. Seems it is not possible with this package.

The usual syntax is along the lines of:

<img src="{{ $message->embed(public_path('img/some-random-image.png')) }}" />

This fails with an exception tho:

Undefined variable: message 

Stack trace:

#0 /home/XX/resources/views/emails/users/XX.blade.php(36): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Undefined varia...', '/home/XX/s...', 36, Array)
#1 /home/XX/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(43): include('/home/XX/s...')
#2 /home/XX/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\\View\\Engines\\PhpEngine->evaluatePath('/home/XX/s...', Array)
#3 /home/XX/vendor/facade/ignition/src/Views/Engines/CompilerEngine.php(36): Illuminate\\View\\Engines\\CompilerEngine->get('/home/XX/r...', Array)
#4 /home/XX/vendor/laravel/framework/src/Illuminate/View/View.php(143): Facade\\Ignition\\Views\\Engines\\CompilerEngine->get('/home/XX/r...', Array)
#5 /home/XX/vendor/laravel/framework/src/Illuminate/View/View.php(126): Illuminate\\View\\View->getContents()
#6 /home/XX/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#7 /home/XX/vendor/asahasrabuddhe/laravel-mjml/src/Process/MJML.php(64): Illuminate\\View\\View->render()
#8 /home/XX/vendor/asahasrabuddhe/laravel-mjml/src/Mail/Mailable.php(66): Asahasrabuddhe\\LaravelMJML\\Process\\MJML->renderHTML()
#9 /home/XX/vendor/asahasrabuddhe/laravel-mjml/src/Mail/Mailable.php(41): Asahasrabuddhe\\LaravelMJML\\Mail\\Mailable->buildMjmlView()
#10 /home/XX/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(153): Asahasrabuddhe\\LaravelMJML\\Mail\\Mailable->buildView()
@dinamic
Copy link
Author

dinamic commented Dec 12, 2019

I presume the inspiration behind implementing MJML support was the markdown one, which lacks support for $message as well.

laravel/framework#19046

@asahasrabuddhe
Copy link
Owner

@dinamic you’re right but I’m open to implementing it in a different way to make it possible

@shayneoneill
Copy link

Was this ever resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants