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
Is this when sendind plain text emails or HTML emails? In case of HTML, what module do you use for it?
#2
plain text.
#3
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
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
Thanks to burn_ru for investigation and code. Please test the attached patch and I will be happy to commit.