The Onebox for this link looks like this in the notification email:
AI-generated summary
The discussion addresses a bug where onebox images in email notifications appear excessively large. dandv first reported the issue, showing an example where a onebox image stretched to 690px width. zogstrip traced the root cause to a year-old CSS change by codinghorror, which removed a max-width:100% rule meant to constrain image sizes in emails. codinghorror acknowledged the oversight, noting the change was intended to fix overly wide images but mistakenly applied globally, breaking onebox rendering. riking suggested a proper fix using width: 100%; max-width: 75px;. codinghorror confirmed the bug also caused images to stretch unnaturally on mobile (e.g., iPhone), citing markup with width="auto" and missing max-width. zogstrip deployed a fix via commit e2121c2. Later, sam identified a remaining issue: thumbnail classes from external Discourse oneboxes weren’t being styled correctly in emails. techAPJ resolved this with commit 1b2bd36, completing the fix.
Just reverted a changed made 1 year ago
by @codinghorror
https://github.com/discourse/discourse/commit/6c2978168729df6c654665cb527811b220a03079
I think the reason I made that change is some images were showing up wider than the email. But it definitely should not have applied to onebox images. I suspect this will cause problems since the case cited above is specific to oneboxes, whereas that CSS change was about the whole email. We’ll see..
Looks like what you’re supposed to do for that is:
width: 100%;
max-width: 75px;
Yeah this has screwed up my email notifications on iPhone with images now look super wide, as they ‘stretch’ to the size of the largest image, like this:
The actual markup is
<img src="image.png" width="auto" height="auto" class="CToWUd">
The line that was incorrectly removed is
add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/
Since there is no max width, the email will just become super tiny / wide if the embedded image is very wide.
Just pushed a proper fix ![]()
https://github.com/discourse/discourse/commit/e2121c2c2c8b941d08231078b2e9fb09612785ea
I think there is one more case we have not handled here:
The thumbnail class is not being properly resolved in emails when oneboxing an external Discourse forum.
@techAPJ can you sort this one out?


