jdavidbakr / mail-tracker

Package for Laravel to inject tracking code into outgoing emails.
MIT License
567 stars 129 forks source link

[6.0] MixedPart messages cause exception #172

Closed avdb closed 2 years ago

avdb commented 2 years ago

I get the same error as https://github.com/jdavidbakr/mail-tracker/pull/167 but then for MixedPart mime part. Shared my error below. Looks like if(get_class($original_content) == AlternativePart::class) { should be also for the mixedPart ? Call to undefined method Symfony\Component\Mime\Part\Multipart\MixedPart::getBody()

I assume it's because we add a file to the message.

https://flareapp.io/share/omwaojZ7#F120

The code I use to send a mail:

return (new MailMessage())
    ->subject(config('app.name'))
    ->line($line)
    ->attach(storage_path('app/'.$this->fileName));
jdavidbakr commented 2 years ago

See if https://github.com/jdavidbakr/mail-tracker/releases/tag/6.0.3 fixes it

avdb commented 2 years ago

awesome thanks!

novelnet commented 2 years ago

Does not work with embedding images (maybe as it's base64 encoded?!): <img src="{{ $message->embed(storage_path('app/mail-inline-attachments/youtubecirclecolored.png')) }}"> Getting this error now: Call to undefined method Symfony\\Component\\Mime\\Part\\Multipart\\RelatedPart::getBody()"