# Onebox images in email notifications are HUGE

**URL:** https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778
**Category:** Bug
**Created:** [10월 21, 2015, 11:17오후 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778 "2015-10-21T23:17:30Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [10월 21, 2015, 11:17오후 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/1 "2015-10-21T23:17:30Z")

</div>

The Onebox for [this link](https://forum.quantifiedself.com/t/23andme-data-analysis-tools/820/4?u=Dan_Dascalescu) looks like this in the notification email:

 ![](https://global.discourse-cdn.com/meta/original/3X/c/b/cbdffb33559c6fcbcfcec46c3d00e117f503f288.png)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [10월 22, 2015, 5:47오후 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/2 "2015-10-22T17:47:25Z")

</div>

Just reverted a changed made 1 year ago 😲 by @codinghorror

[https://github.com/discourse/discourse/commit/6c2978168729df6c654665cb527811b220a03079](https://github.com/discourse/discourse/commit/6c2978168729df6c654665cb527811b220a03079)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [10월 22, 2015, 8:48오후 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/3 "2015-10-22T20:48:48Z")

</div>

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..

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [10월 27, 2015, 4:06오전 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/4 "2015-10-27T04:06:59Z")

</div>

Looks like what you’re supposed to do for that is:

```plaintext
width: 100%;
max-width: 75px;

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [10월 30, 2015, 12:27오전 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/5 "2015-10-30T00:27:01Z")

</div>

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:

 ![](https://global.discourse-cdn.com/meta/original/3X/2/d/2ddeb9be526bcb5280b5564559b66920974298a9.png)

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.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [11월 4, 2015, 11:43오전 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/6 "2015-11-04T11:43:21Z")

</div>

Just pushed a proper fix 🍒

[https://github.com/discourse/discourse/commit/e2121c2c2c8b941d08231078b2e9fb09612785ea](https://github.com/discourse/discourse/commit/e2121c2c2c8b941d08231078b2e9fb09612785ea)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [11월 4, 2015, 11:43오전 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/7 "2015-11-04T11:43:25Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2월 25, 2019, 12:23오전 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/8 "2019-02-25T00:23:02Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2월 25, 2019, 12:24오전 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/9 "2019-02-25T00:24:40Z")

</div>

I think there is one more case we have not handled here:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/c/dc42019ee225064edf394f23822b7030e04cb6bb.png)

[https://review.discourse.org/t/feature-add-f-and-t-search-shortcuts-for-first-post-title/1854/2?u=samsaffron](https://review.discourse.org/t/feature-add-f-and-t-search-shortcuts-for-first-post-title/1854/2?u=samsaffron)

The `thumbnail` class is not being properly resolved in **emails** when oneboxing an external Discourse forum.

@techAPJ can you sort this one out?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [3월 5, 2019, 5:54오후 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/11 "2019-03-05T17:54:38Z")

</div>

Fixed via

[https://github.com/discourse/discourse/commit/1b2bd3606191da4054c45664abfcc7ffaf9cda7d](https://github.com/discourse/discourse/commit/1b2bd3606191da4054c45664abfcc7ffaf9cda7d)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [3월 5, 2019, 5:54오후 UTC](https://meta.discourse.org/t/onebox-images-in-email-notifications-are-huge/34778/12 "2019-03-05T17:54:45Z")

</div>


