# Links broken in Email, encode or other alternatives?

**URL:** <https://www.ruby-forum.com/t/links-broken-in-email-encode-or-other-alternatives/107459>\
**Category:** Rails\
**Created:** [June 21, 2007, 11:25pm UTC](https://www.ruby-forum.com/t/links-broken-in-email-encode-or-other-alternatives/107459 "2007-06-21T23:25:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@rafael](https://www.ruby-forum.com/u/rafael)\
**Post date:** [June 21, 2007, 11:25pm UTC](https://www.ruby-forum.com/t/links-broken-in-email-encode-or-other-alternatives/107459/1 "2007-06-21T23:25:48Z")

</div>

Hi everybody,

may sombody has a solution for this problem?  
When I send links like that:

[http://www.example.org/user/welcome?user[id]=22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5](http://www.example.org/user/welcome?user%5Bid%5D=22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5)

This Link is not clickable, the link breaks like this

[http://www.ella.org/user/welcome?user[id]](http://www.ella.org/user/welcome?user%5Bid%5D)  
=22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5

Does anybody know, how I could ensure, that the link remains  
clickable?

Thank you for every hint!

greetinx

Rafael

---

<div class="post-metadata">

**Author:** ![rafael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@rafael](https://www.ruby-forum.com/u/rafael)\
**Post date:** [June 21, 2007, 11:59pm UTC](https://www.ruby-forum.com/t/links-broken-in-email-encode-or-other-alternatives/107459/2 "2007-06-21T23:59:54Z")

</div>

Rafael wrote:

> =22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5

Use alternative parts in your email with an HTML and a pure-text  
versions of your e-mail. People using mail clients that don’t show HTML  
usually know how to rebuild the link from the pieces and won’t blame the  
problem on you. The HTML version should protect the links.

From my experience, you’ll have to spend quite some time in the docs  
and source code of both Tmail and ActionMailer when playing with mime  
like that…

Lionel

---

<div class="post-metadata">

**Author:** ![rafael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@rafael](https://www.ruby-forum.com/u/rafael)\
**Post date:** [June 22, 2007, 9:37am UTC](https://www.ruby-forum.com/t/links-broken-in-email-encode-or-other-alternatives/107459/3 "2007-06-22T09:37:42Z")

</div>

On 6/21/07, Rafael [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [http://www.ella.org/user/welcome?user[id]](http://www.ella.org/user/welcome?user%5Bid%5D)  
> =22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5
> 
> Does anybody know, how I could ensure, that the link remains  
> clickable?

Try typing the url inside a pair of angle brackets, i.e.:  
[http://www.example.org/user/welcome?user[id]=22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5](http://www.example.org/user/welcome?user%5Bid%5D=22&key=2a965027574e6bd0418f5b9b72c875a49d464fc5)

HTH,  
Isak

---

<div class="post-metadata">

**Author:** ![rafael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@rafael](https://www.ruby-forum.com/u/rafael)\
**Post date:** [June 23, 2007, 2:50pm UTC](https://www.ruby-forum.com/t/links-broken-in-email-encode-or-other-alternatives/107459/4 "2007-06-23T14:50:56Z")

</div>

Thank you very much for your help

here a little tip back, which I found in Rails Recipes.  
I go for the multipart/alternative solution.

Sending an email as HTML AND Plaintext makes sense and is for me, the  
way to go.  
What helped me, to find a quick solution on changing the Action Mailer  
behaviour in  
Login Sugar, act\_as\_authenticated was this very helpful book  
“Rails Recipes” look for the Recipe `Send Gracefully Degrading Rich- Content Emails`.

Hope this help some people more out there.

Greetings

Rafael
