Closed novelnet closed 2 years ago
I tried to make a test case for this but can't figure out how to get it to be called. Can you give more context about where the $message variable is coming from, and perhaps look at the tests and put here a way to compose a message that calls $message->embed()
?
@jdavidbakr thank you! I made an example test for an inline embedded image which is working when disabling the mail-tracker by adding:
->withSymfonyMessage(function ($message) { $message->getHeaders()->addTextHeader('X-No-Track', Str::random(10)); })
To embed an inline image, use the embed method on the $message variable within your email template. Laravel automatically makes the $message variable available to all of your email templates, so you don't need to worry about passing it in manually:
Thanks @novelnet - that was what I needed. Fixed in https://github.com/jdavidbakr/mail-tracker/releases/tag/6.0.4
Thanks! :)
I get the following error when sending mails with inline embedded images:
Call to undefined method Symfony\\Component\\Mime\\Part\\Multipart\\RelatedPart::getBody()
Example:
<img src="{{ $message->embed(storage_path('app/mail-inline-attachments/youtubecirclecolored.png')) }}">
The image source gets automatically base64 encoded.