endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.33k stars 721 forks source link

Image embedded in email contains full path to image #440

Closed craigkendall closed 4 months ago

craigkendall commented 4 months ago

New to all this so any help (or graciousness on errors in implementation) appreciated!

I am using endroid qr-code to generate qr codes to be used to check in will-call list folks at an event.

I have the qr-code generating and saving to a private folder (qr) one level above my webroot on my server.

I'm creating a temporary symlink to the private folder on the fly in the code (then destroying the symlink after its no longer needed).

The saved qr code filename is generated for each based on the individual - like: qr---.png (where are variable data).

My line in the page that sends the email using PHPMailer is: <img style="width:200px;height:auto;" alt="PHPMailer" src="cid:qr-code">

But when saving the embedded qr code from the resulting email the filename (in Gmail - using the download icon) the filename shows as: home__qr_qr-1-Mary-Jones.png

I see the "/" are being replaced by "_" but can anyone tell me if it's possible to remove the home_qr when sending the email so it just has a filename of qr-1-Mary-Jones.png ?

THANKS!

endroid commented 4 months ago

Hi @craigkendall I am not familiar with PHPMailer so I can not answer this question. This page mentions some AddEmbeddedImage method where you can pass a filename. Maybe you can use that. Good luck!

craigkendall commented 4 months ago

Thanks @endroid - I realized it wasn't PHPMailer but my use of temporary symlinks that was failing. I changed that up and it's working mostly as I intended now. Appreciate the response and the great library.