Skip to content

[10.x] Render mailable inline images - #48292

Merged
taylorotwell merged 6 commits into
laravel:10.xfrom
pniaps:render_mailables_images
Sep 12, 2023
Merged

[10.x] Render mailable inline images#48292
taylorotwell merged 6 commits into
laravel:10.xfrom
pniaps:render_mailables_images

Conversation

@pniaps

@pniaps pniaps commented Sep 4, 2023

Copy link
Copy Markdown
Contributor

This PR adds support to render inline images when previewing mailables in the browser.

This code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
<div style="text-align: center">
    <img src="{{ $message->embed(public_path('1x1-000000ff.png')) }}" alt="img alt">
</div>
</body>
</html>

was rendered as

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="text-align: center">
<img src="cid:GRM6dF7cV3" alt="img alt">
</div>
</body>
</html>

But this commit renders it as

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="text-align: center">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YA
AAAASUVORK5CYII=" alt="img alt">
</div>
</body>
</html>

@driesvints driesvints changed the title Render mailable inline images [10.x] Render mailable inline images Sep 4, 2023
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

Successfully merging this pull request may close these issues.

2 participants