Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Render mailable inline images #48292

Merged
merged 6 commits into from
Sep 12, 2023

Conversation

pniaps
Copy link
Contributor

@pniaps pniaps commented Sep 4, 2023

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
@taylorotwell taylorotwell merged commit 81f3dba into laravel:10.x Sep 12, 2023
19 checks passed
@pniaps pniaps deleted the render_mailables_images branch September 12, 2023 12:02
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.

None yet

2 participants