Newsletter Doesnt work

newsletter doesnt also work well. i have everything set up fine and i send it it fine. But, when the emails comes all my hyperlinks changes. :?

if i make the newsletter from the admin side and insert an image, image doesnt appear in the email. also when i click on the image or text link it just doesnt open the website.



when i look at the source code of the email i get:


Free Australian Opal with Blue Topaz Bracelet and Ring. Worth Over $800 USD




( this one is sent from demo cscart which i get exactly the same error.)

i think the error come from the "\" which you can see right after the href=
which should not be there. when i look at the code i see:


$newsletter_data = array();
foreach ($data['send_ids'] as $newsletter_id) {
$n = array();
foreach ((array)Registry::get('languages') as $lang_code => $v) {
$n[$lang_code] = fn_get_newsletter_data($newsletter_id, $lang_code);
list($n[$lang_code]['body_txt'], $n[$lang_code]['body_html']) =[COLOR="Red"] fn_rewrite_links($n[$lang_code][/COLOR]['body_txt'], $n[$lang_code]['body_html'], $newsletter_id, $n[$lang_code]['campaign_id']);
}

so is there is an error in the code that change my links?
i think no one has sent any newsletters yet with the 2.7 version.
any help would be appreciated. thanks

no one??? what kind of internet business you guys are running??? no one uses newsletter?

[quote name=‘silverbestbuy’]no one??? what kind of internet business you guys are running??? no one uses newsletter?[/QUOTE]



I think you underestimate the time it takes for coders to take the new software through its paces - and aside from that, there are more bugs besides your own personal favorite.



Despite this, consider the following in /addons/news_and_emails/func.php:



```php // if called first time - registers all links in db

// returns newsletter bodies with rewritten links

function fn_rewrite_links($body_txt, $body_html, $newsletter_id, $campaign_id)

{

$regex = “/href=('|")((?:http|ftp|https)://[\w-.]+[?]?[-\w:/?.=%&;~[]]+)/ie”;

$url = Registry::get(‘config.http_location’) . ‘/’ . Registry::get(‘config.customer_index’) . ‘?dispatch=newsletters.track’;

$replace_regex = “‘href=$1$url&link=’ . fn_register_link(‘$2’, $newsletter_id, $campaign_id) . ‘-’ . $newsletter_id . ‘-’ . $campaign_id”;

$matches = array();

$body_txt = preg_replace($regex, $replace_regex, $body_txt);

$body_html = preg_replace($regex, $replace_regex, $body_html);



return array($body_txt, $body_html);

} ```



In that replace_regex line… “‘href=$1… etc. That is where this slash is coming from. It seems to anticipate the need to escape quotes for PHP which is not useful in the html scenario UNLESS you have a need to escape it (i.e. if it is being embedded in client javascript, etc.) You could try deleting that slash, leaving:



```php

$replace_regex = "‘href=$1$url&link=’ . fn_register_link(’$2’, $newsletter_id, $campaign_id) . ‘-’ . $newsletter_id . ‘-’ . $campaign_id”;

```



That whole line is very sloppily trying to take advantage of the variable population aspect of containing everything in double quote while also concatenating portions in single quotes… I haven’t tested out any alternative equivalent rewrites and I am short on time at the moment… perhaps another coder can see what I’m talking about and play around.



It IS necessary to escape the double quote in the first $regex line, but I don’t see why the slash is necessary before $1 (matching regex pattern 1 to test for opening parameter quotes for the href attribute).

thanks m8 , but i have already tried that and no luck.

Hi silverbestbuy, we’ve ditched the built in newsletter functionality and gone with a dedicated system. It is sooo worth it. The ease of use, bomber delivery, and statistics it provides are worth the small monthly fee.



We’ve been using MailChimp and been really, really happy with it. They’ve also recently started a free program, I think up to 500 subscribers. We just inserted the mailchimp newsletter signup form into a block, and let it roll. It’s pretty painless, and the resulting data is awesome.



Other well known providers are constantcontact, eroi, and a bunch of others.



Good luck!

Jason

I am also having problems creating a newsletter in that when I add a URL into the HTML body section, the URL displays fine in the test email, however, when I click the link it opens a page in the browser with a truncated URL like this: http:///



The text version email links work just fine, only the HTML version emails are doing this.



I really need to get a newsletter out this weekend, so if anyone knows how to fix this it would be greatly appreciated…Thanks!

Thanks Jagorny for pointing me in the right direction as your fix did the trick!



Took me two tries, however 2nd time around the URL’s are now resolved properly.

ok what i did was to delete the:



$body_txt = preg_replace($regex, $replace_regex, $body_txt);

$body_html = preg_replace($regex, $replace_regex, $body_html);



from /addons/news_and_emails/func.php



now it works fine. For some reason they wanted to change the link (rewrite) anyone knows why???

We are running 2.0.8 version and face the same problem as above.

1 hour of testing did its job.

Now everything seems to be working fine and clicks are both counted in admin section and are working properly in the letters.



The line 406 (approx) in addons/news_and_emails_/func.php should look like:



[COLOR=“YellowGreen”]$replace_regex = "‘href=$url&link=’ . fn_register_link(‘$2’, $newsletter_id …[/COLOR]



[COLOR=“Red”]not $replace_regex = "'href=/$1$url&link=’ . fn_registe[/COLOR]

can you all tell me how to get the newsletter to show up on the page for folks to sign up for the newsletter /?

The newsletter is terrible, if you like to use really good Software for NL take [url]http://www.interspire.com/emailmarketer/[/url] it is the best Software that i know.

[QUOTE]The newsletter is terrible, if you like to use really good Software for NL take [url]http://www.interspire.com/emailmarketer/[/url] it is the best Software that i know.[/QUOTE]



And, it is only $500.00 per Year, how do they do it…! :wink:

Check out Atomic Mail Sender - [url]http://www.amailsender.com/massmailer/[/url]

[quote name=‘Struck’]And, it is only $500.00 per Year, how do they do it…! ;)[/QUOTE]



500 per Year??? No, it cost 495 with 12 month support, but you can only buy this script and use it for 10 years if you like!



“Your purchase includes 12 months of unlimited free support and upgrades”



And :wink: very good things were everytime not cheap, but therefore you have a great marketing tool!

[quote name=‘Lyn’]Check out Atomic Mail Sender - [url]http://www.amailsender.com/massmailer/[/url][/QUOTE]



WOW very good Software, compare it with my suggestion and you kick it! Beleave me!

[quote name=‘Triplex’]WOW very good Software, compare it with my suggestion and you kick it! Beleave me![/QUOTE]



Yes, it is very easy to use, very cheap and you can also run it from your local pc. You can sign up for the tracking feature as well, which is also very cheap.



I found the CS-Cart newsletter couldn’t handle any quantity, it was taking ages to send and I had no idea who was getting their newsletters and who wasn’t.



I have found their support to be really good as well.

I’m having a problem with the trackable links in 2.0.12. Everything looks and sends fine. I have these links in the received email “Domain.com”, but they all go to the 404 page. Any ideas?

[quote name=‘interfaceFactory’]I’m having a problem with the trackable links in 2.0.12. Everything looks and sends fine. I have these links in the received email “Domain.com”, but they all go to the 404 page. Any ideas?[/QUOTE]

I am having the same problem. Do any of the experts know how to fix this bug? It is pretty serious because it makes the newsletter appear unprofessional to the customers.

Hey I’m having the same problem interfaceFactory has, does anyone have any idea of how to fix it? I figured out the links go to a 404 Not Found page only in html emails, whereas they work just fine in plain text newsletters. What can be causing this problem in html newsletter?



Any idea is greatly appreciated.

The dev’s had me do this in fn.common.php:



Replace:

$location = str_replace(Registry::get(‘config.http_location’) . ‘/’, ‘’, $location);





with:



$location = str_replace(array(Registry::get(‘config.http_location’) . ‘/’, Registry::get(‘config.http_location’)), ‘’, $location);





Replace:



$location = str_replace(Registry::get(‘config.https_location’) . ‘/’, ‘’, $location);





with:



$location = str_replace(array(Registry::get(‘config.https_location’) . ‘/’, Registry::get(‘config.https_location’)), ‘’, $location);



It works after these edits (2.0.12)