-
Notifications
You must be signed in to change notification settings - Fork 28
Embedding an image twice in one email #411
Comments
Probably a good thing to add... I'm just curious what the use case is though? Why would you want to embed the exact same image twice? |
Maybe the site logo? One on the header and one on the footer? Dunno. Seems like a good thing to support. |
@tomschlick |
Ah ok, I wasn't thinking about things like that. I was thinking more along the lines of photo attachments. 👍 from me. You're probably good to submit a PR on this. I don't see how it could be a bad thing to do this. |
@taylorotwell Can I have your opinion about this before submitting a PR? |
Sounds ok to me. |
All merged, can be closed now? 😄 |
Sure. |
Is there any built-in functionality for embedding the same image several times in one email?
If I do
recipient receives a message with two identical attachments.
One way I can get it to attach it once is to save the CID of an attachment and use it twice:
Do you know any other options?
Maybe the
Illuminate\Mail\Message::embed
should check if the same file path occurred before in the message and if so, return the previous CID instead of generating a new one.It would look something like this:
It will be a breaking change only in an edge case when someone changes the file contents between two calls to
embed
, so it's probably nothing to worry about.The text was updated successfully, but these errors were encountered: