# Full URL for image in text/plain emails

**URL:** https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198
**Category:** Support
**Created:** [4월 18, 2017, 3:09오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198 "2017-04-18T15:09:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ihnorton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihnorton/32/121072_2.png) [@ihnorton](https://meta.discourse.org/u/ihnorton)
#### Post date: [4월 18, 2017, 3:09오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/1 "2017-04-18T15:09:50Z")

</div>

In the the `text/plain` version of emails from Discourse, `<img>` URLs are relative. For example, the email notification for [this post](https://discourse.slicer.org/t/external-calling-at-slicer-3d/136) has the full URL in `text/html`, but only the relative URL in `text/plain`.

> **example email contents**
>
> ```plaintext
> ----==_mimepart_58f541ae7b23d_15dd3fe30efca3ec4330ef
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: 7bit
> 
> Hi everybody,
> 
> I am programming an extension module for Slicer 3D. In one step I need to call an external command (Elastix). At this point is when I obtain the following error:
> 
> <img src="/uploads/slicer/original/1X/6e7cf603bea688a3821efdb228bd5f65599bcb13.jpg" width="690" height="25">
> 
> I have not been able to solve it yet. Do you know how get rid of this problem? It works when I execute the call in a terminal.
> 
> I look forward to hearing from you. Thanks in advance.
> 
> Sincerely,
>  
> 
> Alba.
> 
> ---
> [Visit Topic](http://discourse.slicer.org/t/external-calling-at-slicer-3d/136/1) or reply to this email to respond.
> You are receiving this because you enabled mailing list mode.
> 
> To unsubscribe from these emails, [click here](http://discourse.slicer.org/email/unsubscribe/a6d3f9070a2ff5be8ac754586568b0e2829ade0f9669f001b039e8e4498bbe56).
> 
> ----==_mimepart_58f541ae7b23d_15dd3fe30efca3ec4330ef
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: 7bit
> 
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><p></p><div style="margin-left: 15px">
> <br>Hi everybody,
> 
> <p>I am programming an extension module for Slicer 3D. In one step I need to call an external command (Elastix). At this point is when I obtain the following error:</p>
> 
> <p><img src="http://discourse.slicer.org/uploads/slicer/original/1X/6e7cf603bea688a3821efdb228bd5f65599bcb13.jpg" width="auto" height="auto" style="max-width: 100%;"></p>
> 
> <p>I have not been able to solve it yet. Do you know how get rid of this problem? It works when I execute the call in a terminal.</p>
> 
> <p>I look forward to hearing from you. Thanks in advance.</p>
> 
> <p>Sincerely,</p>
> 
> <p>Alba.</p>
> 
> <p></p>
> </div>
> 
> <hr>
> 
> <p><a href="http://discourse.slicer.org/t/external-calling-at-slicer-3d/136/1">Visit Topic</a> or reply to this email to respond.<br>You are receiving this because you enabled mailing list mode.</p>
> 
> <p>To unsubscribe from these emails, <a href="http://discourse.slicer.org/email/unsubscribe/a6d3f9070a2ff5be8ac754586568b0e2829ade0f9669f001b039e8e4498bbe56">click here</a>.</p>
> ----==_mimepart_58f541ae7b23d_15dd3fe30efca3ec4330ef--
> 
> ```

I see there have been several related discussions and PRs in the past:

[https://meta.discourse.org/t/some-links-in-emails-not-including-the-full-url/11211](https://meta.discourse.org/t/some-links-in-emails-not-including-the-full-url/11211)

[https://meta.discourse.org/t/links-in-mail-lack-http-s-protocol/15794](https://meta.discourse.org/t/links-in-mail-lack-http-s-protocol/15794)

[Fix relative URLs in plain text emails by peternlewis · Pull Request #2448 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/2448)

But I don’t see any current/open topics regarding this issue. Is there a configuration option I missed, or any work-around available? (after a few rounds of tweaks, this is the last major complaint about email mode from our [die-hard mailing list user](https://discourse.slicer.org/t/email-mode-config-improvements/140)).

---

<div class="post-metadata">

### Author: ![ihnorton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihnorton/32/121072_2.png) [@ihnorton](https://meta.discourse.org/u/ihnorton)
#### Post date: [4월 18, 2017, 9:00오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/2 "2017-04-18T21:00:57Z")

</div>

Looking through the code and PR2448 more closely, the resolution to that PR, [db5f2ae](https://github.com/discourse/discourse/commit/db5f2ae88c14f259180d27425f87a46a29ff33d9), only addressed the html output of the renderer. So I guess [this substitution](https://github.com/discourse/discourse/blob/521c88fe58af5b264d04e349d5a41e5a776b4611/lib/email/sender.rb#L60-L61) would also need to be applied to `text_part`?

Unless I hear otherwise, I’ll make a PR to that effect once I get an environment set up to verify the change.

(I suppose any change will take some time to be deployed on Standard, even if accepted… So I’ll ask the user to apply that regex locally for now if they want to use a text-only viewer)

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [4월 18, 2017, 9:37오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/3 "2017-04-18T21:37:01Z")

</div>

I haven’t delved into the code, but as a user I’ve noticed various lack-of-full URL issues.

In my most recent Meta Digest mailing, I see full URLs in markdown format in the plain text part of the mail:

```plaintext
[:success:](https://global.discourse-cdn.com/meta/original/3X/b/1/b1be...) 
[image](https://global.discourse-cdn.com/meta/optimized/3X/5/a/5af8...)

```

But I have seen ones like your example above (`<img src="//discourse-meta.s3...`) in the past. It may have to do with how the message was originally encoded, eg originally just a bare URL on a line versus in markdown.

The “[Download My Posts](https://meta.discourse.org/t/can-download-my-posts-output-have-consistently-useful-inline-images/53828/1)” output uses the protocol less version here at Meta, but I’ve also seen lacking protocol and hostname (`<img src="/uploads/default/original/...`).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [5월 26, 2019, 7:36오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/4 "2019-05-26T19:36:05Z")

</div>



---

<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: [5월 26, 2019, 7:37오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/5 "2019-05-26T19:37:09Z")

</div>

Do we still have this issue with text/plain content in emails @tshenry?

---

<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: [5월 26, 2019, 11:01오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/6 "2019-05-26T23:01:12Z")

</div>

We still have the issue with quotes and upload urls, we have ideas on how to improve but it is not an easy task.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [10월 14, 2022, 8:12오후 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/7 "2022-10-14T20:12:17Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [10월 22, 2022, 7:49오전 UTC](https://meta.discourse.org/t/full-url-for-image-in-text-plain-emails/61198/8 "2022-10-22T07:49:25Z")

</div>


