Steps to recreate:
1) Create a newsletter issue and put the following in the body:
Before http://someplace.com After
2) Send the newsletter
3) Receive as a plain text email:
Before http://someplace.com http://someplace.com After
(Both URLs are converted to links)

I have tracked the problem down to simplenews_html_to_text(). In my example it is receiving this:

<p>Before:<br />
<a href="http://someplace.com" title="http://someplace.com">http://someplace.com</a><br />
After.</p>

_simplenews_absolute_mail_urls() returns this:

<p>Before:<br />
http://someplace.com http://someplace.com<br />
After.</p>

I'm curious what the return line for _simplenews_absolute_mail_urls() was meant to do?
return $label .' '. $url;

In my case, it just repeats the same URL twice.

Thanks

Comments

Karlheinz’s picture

Status: Closed (duplicate) » Active

It makes sense if you believe that a link's URL and its text will be different, e.g.
<a href="http://www.example.com">Example</a>
...becomes
Example http://www.example.com

For a solution, see burn_ru's comment here:
http://drupal.org/node/476756

If you don't want to look, the solution is to look for the _simplenews_absolute_mail_urls function in simplenews.module, and replace this:

return $label .' '. $url;

...with this:

if ($label == $url) {
    return $url;
  }
  else {
   return $label .' '. $url;
  }

EDIT: See the duplicate thread for a patch. I haven't tried it yet, but it looks solid.

sutharsan’s picture

Status: Active » Closed (duplicate)

Status: Active » Closed (duplicate)