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

Fix: Ensure content_id consistency with Laravel Mailer for inline attachments #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ysfks
Copy link

@ysfks ysfks commented Dec 19, 2024

Description

This PR addresses an issue where inline images embedded in emails sent via the laravel-sendgrid-driver do not display correctly in Gmail. The root cause is a mismatch between the Content-ID assigned to the inline attachment and the cid used in the email’s HTML.

Problem
• Laravel Mailer uses a custom cid for inline attachments generated by $message->embed() instead of the Content-ID generated by Symfony Mailer.
• The mismatch breaks the cid reference in Gmail, causing inline images to fail to render, even though they work in other email clients (e.g., Outlook).

Solution
• Update the SendgridTransport.php file to use Laravel’s attachment name as the content_id for inline attachments.
• This ensures consistency between the Content-ID and the cid reference, resolving the rendering issue in Gmail.

Copy link

@kohlerdominik kohlerdominik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and can confirm this works

@kohlerdominik
Copy link

@s-ichikawa could you have a look at that

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