We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

URL Encoding Woes with Multiple Newsletters Extension

Development and Programming

smartpill's avatar
smartpill
456 posts
17 years ago
smartpill's avatar smartpill

I’m trying to use the Multiple Newsletters Extension (v.1.1) to allow the client to send HTML formatted newsletters. I’ve turned off both “Automatically Convert High ASCII Text to Entities” and “Automatically turn URLs and email addresses into links?” but on the “communicate” page I still end up with this:

This is a <a href="http://the_site_url.com/index.php?URL=http://the_target_url" title="test">test</a>

Am I missing something? The HTML looks correct in the entry itself. I’m using 1.6.3 Build: 20080421

Edit: Oh that figures, it looks correct here. I’ll add a screenshot.

Should be:

This is a <a href="http://the_target_url.com" title="test">test</a>

The links look like they’re being encoded as if they were redirects for some reason.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
17 years ago
Sue Crocker's avatar Sue Crocker

Since this is a third party extension, I’m going to move it to the Extension forum.

       
smartpill's avatar
smartpill
456 posts
17 years ago
smartpill's avatar smartpill

OK. I modified the first post so it would be more appropriate for the extensions forum, thanks.

       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

I’ve been trying to find a solution to this too. I’m guessing it’s because all links created within the admin CP have the ?URL= appended to them as a security measure to protect the admin, but is there a way to turn this off for newsletters?

       
Michael Byström's avatar
Michael Byström
23 posts
16 years ago
Michael Byström's avatar Michael Byström

In “ext.multiple_newsletters.php” around line nummber 192 add this line

$newsletter = str_replace("http://yourdomain.com/?URL=http % 3 A % 2 F % 2 F", "http://", $newsletter);

This will fix the URL problem. Stay warm -Michael

       
Michael Byström's avatar
Michael Byström
23 posts
16 years ago
Michael Byström's avatar Michael Byström
In “ext.multiple_newsletters.php” around line nummber 192 add this line
$newsletter = str_replace("http://yourdomain.com/?URL=http % 3 A % 2 F % 2 F", "http://", $newsletter);
NOTE that
http % 3 A % 2 F % 2 F
is written with no whitespace. The forum is encoding it to html. This will fix the URL problem. Stay warm -Michael
       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill
In “ext.multiple_newsletters.php” around line nummber 192 add this line
$newsletter = str_replace("http://yourdomain.com/?URL=http % 3 A % 2 F % 2 F", "http://", $newsletter);

Thanks!

I had to modify it to include the index.php page I still have in there and made a variant for a secure page, but it does the trick! Thanks for pointing out to remove the spaces.

$newsletter = str_replace("http://thediaperbank.org/index.php?URL=http % 3 A % 2 F % 2 F", "http://", $newsletter);

$newsletter = str_replace("http://thediaperbank.org/index.php?URL=https % 3 A % 2 F % 2 F ", "https://", $newsletter);
       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

Hey thanks Michael, will try that out.

       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

I’ve run into a problem with this again. Michael’s solution works fine for links to external sites in a newsletter, but links to pages on your own site then end up looking like http://path-to-page/

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.