URL displayed twice in email

taite11 - May 29, 2009 - 17:29
Project:Simplenews
Version:6.x-1.0-rc6
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I'm using the "Full HTML" input format. When I include a link in the format "www.example.com" or "http://www.example.com", the link will show up in the email twice. If I include the link as "example.com" it will only show up once.

#1

Sutharsan - May 30, 2009 - 05:32

Is this when sendind plain text emails or HTML emails? In case of HTML, what module do you use for it?

#2

taite11 - May 30, 2009 - 14:22

plain text.

#3

burn_ru - July 30, 2009 - 12:08

If node text contain single url html filter convert it to a href tag with link_label == url

After that simplenews convert it to plain text in format $label.' '.$url

According this single url in plain text mail message write twice

I fixed this in_simplenews_absolute_mail_urls function in simplenews.module

old code:

   return $label .' '. $url;

new code:

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

#4

Karlheinz - November 6, 2009 - 16:34

Some things to check:

Likely your problem is how links are converted to plaintext in your newsletter's settings. Go to "Administer > Content management > Newsletters." For each newsletter, click on "Edit Newsletter." At the bottom you will see radio-buttons labeled "Hyperlink conversion." Try changing it to "Append hyperlinks as a numbered reference list" and see what happens.

Also, the input format of the Newsletter body might be converting URL's to clickable links. You can turn this off, but it will be site-wide, not just for newsletters. Go to "Administer > Site configuration > Input formats" and edit your input format's setting. If "URL filter" is checked, un-check it.

In any case - The code posted by burn_ru is a good idea. Any way to implement it without hacking simplenews.module?

#5

Sutharsan - November 7, 2009 - 15:48
Status:active» needs review

Thanks to burn_ru for investigation and code. Please test the attached patch and I will be happy to commit.

AttachmentSize
simplenews.476756.patch 888 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.