CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Embedded links in CiviMail messages failing
Pages: [1]

Author Topic: Embedded links in CiviMail messages failing  (Read 3142 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Embedded links in CiviMail messages failing
January 21, 2011, 02:47:36 pm
I'm running CiviCRM 3.1.4 on a Drupal 6 site for a client (so this may be bug that has already been addressed, but I thought I'd post this anyway in case it is not):

Just sent a message to a fairly small number of recipients using CiviMail. The message included links to external sites and also to a couple of pages on the site (one a Drupal node and one a CiviCRM event info page), and the click tracking is enabled.

I quickly received a report from a recipient of the message that the link to the on-site Drupal page was broken, and they were getting a 'page not found' error. I checked the link  and found that the link worked perfectly for me when using Safari, but broke when using Firefox and also with Chrome (regardless of whether I was logged in to the site or not). I've yet to check it with IE.

I tested the other links in the same email, which point to third party websites and an internal CiviCRM event info page, and these work fine in all browsers that I've tested. The click-through tracking report for the message indicates that click-throughs to the on-site pages (both Drupal and CiviCRM pages) were working for at least some recipients.

The behaviour of the broken URL with Firefox was as follows:

The embedded link in the email was of the form:
http://www.example.com/sites/all/modules/civicrm/extern/url.php?u=20&qid=1057

And Firefox, having rendered a "page not found", reported the final URL as:
http://www.example.com/sites/all/modules/civicrm/extern/www.example.com/node/1622

where http://www.example.com/node/1622
is the correct URL

Anyone else seen anything like this? Has it been fixed in later versions?
anks
Graham
Th
Graham Mitchell
http://mc3.coop

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Embedded links in CiviMail messages failing
January 21, 2011, 05:11:18 pm

url.php is a fairly small easy file, so your best bet might be to debug the code there. Dont recollect anything similar to this in the recent past

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Embedded links in CiviMail messages failing
January 22, 2011, 07:20:02 pm
I think you may want to check your settings.civicrm.php file and check your BASE URL variable. Is it set?  If not, try setting it and see if that helps.


« Last Edit: January 22, 2011, 07:29:30 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Embedded links in CiviMail messages failing
January 23, 2011, 12:01:38 am
Thanks Stoob,

I've double checked civicrm.settings.php and the base url is indeed correctly set.

Regards
Graham
Graham Mitchell
http://mc3.coop

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Embedded links in CiviMail messages failing
January 23, 2011, 02:55:06 am
Question: Can I test this on the demo site?
Graham Mitchell
http://mc3.coop

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Embedded links in CiviMail messages failing
January 23, 2011, 03:15:41 am
Hi,

The demo sites have the mailing functions disabled (to prevent abuses)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Embedded links in CiviMail messages failing
January 23, 2011, 03:22:23 am
Hi,

Are you sure the links where correct to start with in the original email ? ie. starting with "http://" ?  The wysiwyg and copy/paste have a tendency to "translate" the links into relative urls, and brake it for instance.  Then some browsers are better as handling a specific type of broken links than others.

As for the report, is simply says that someone clicked on the link and it has been forwarded to the page. This page being 404 or not is not taken into account.


Quote from: Upperholme on January 21, 2011, 02:47:36 pm
I quickly received a report from a recipient of the message that the link to the on-site Drupal page was broken, and they were getting a 'page not found' error. I checked the link  and found that the link worked perfectly for me when using Safari, but broke when using Firefox and also with Chrome (regardless of whether I was logged in to the site or not). I've yet to check it with IE.


The embedded link in the email was of the form:
http://www.example.com/sites/all/modules/civicrm/extern/url.php?u=20&qid=1057

And Firefox, having rendered a "page not found", reported the final URL as:
http://www.example.com/sites/all/modules/civicrm/extern/www.example.com/node/1622

where http://www.example.com/node/1622
is the correct URL

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Embedded links in CiviMail messages failing
January 24, 2011, 02:42:37 am
Xavier, thanks for your input. The email content was constructed in 'Source' view so that I could easily double-check the urls and ensure that they were not relative links. I've since gone back and taken another look as this was the most likely cause of errors (i.e. me), but it all looks to be in order.

As for the click tracking report, if this is the case, then perhaps the code for the click tracking needs to be reviewed, as presumably the purpose of that report is to enable the sender to see how successful their email has been, and would therefore wish to see the number of successful click-throughs to correct target pages (assuming that this is possible to track), rather than simply some vague measure that logs solely the fact that a link was clicked on.
Graham Mitchell
http://mc3.coop

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Embedded links in CiviMail messages failing
January 24, 2011, 03:48:53 am
Quote from: Upperholme on January 24, 2011, 02:42:37 am
Xavier, thanks for your input. The email content was constructed in 'Source' view so that I could easily double-check the urls and ensure that they were not relative links. I've since gone back and taken another look as this was the most likely cause of errors (i.e. me), but it all looks to be in order.

No idea then, sorry. Is the url ok in the test emails ?

Quote from: Upperholme on January 24, 2011, 02:42:37 am
As for the click tracking report, if this is the case, then perhaps the code for the click tracking needs to be reviewed, as presumably the purpose of that report is to enable the sender to see how successful their email has been, and would therefore wish to see the number of successful click-throughs to correct target pages (assuming that this is possible to track), rather than simply some vague measure that logs solely the fact that a link was clicked on.

This would mean fetch the target pages and verify that it's not a 404 error. It can't be done at every click for obvious performance reasons. How often should it be done? And what if the page goes down between two controls and someone clicks? And what if it's accessible only from some parts of the net and not others ?  And what if it's an online video that doesn't work even if it's within a page that does? And what if this video is watchable only from some countries? And what if it redirects to a page, and that isn't the page that was intended when you sent the email? or that the page doesn't display properly in the browser of that specific visitor) and what if  ???

Got a few dozen more what if if you want ;). In essence, it isn't possible to cover all the cases, so I'd rather have civi simple and possibly wrong than complex and possibly wrong. Putting the right link and checking it works it the duty of somewhere else.

BTW the report is not vague, it properly tracks how many clicked on the link. That the link points to a correct page that is properly displayed is not a "click" issue.

This being said, all the links are stored in a table, you could develop a cron that read them, fetch the url (in practice, a HEAD request is good enough, no need to GET), and flag the invalid links in some kind of reports (or alert the user that created the mailing. You can check at other programs in the bin folder if you want to start working on it.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Embedded links in CiviMail messages failing
January 24, 2011, 04:09:36 am
As I assumed, doing anything more sophisticated with the click tracker is probably a step too far, for the good reasons you give. I'm also i=firmly in the camp of having civiCRm as simple and robust as it can be given the job it is there to do.

The URLs checked out fine in my test email, as I use Safari as my default browser, and everything went through without a hitch. It was only when I received a report form a user about the 404 error that I checked it in other browsers.
Graham Mitchell
http://mc3.coop

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Embedded links in CiviMail messages failing
January 24, 2011, 09:31:43 am
Update: Finally found the error. Of course it was me - a simple typo. Often the hardest thing to spot I find.

Apologies to all, and thanks for your help.

Just goes to show how forgiving Safari is as a browser, that it still got me there. (Or does that make it flawed and insecure? - I guess it depends where you are coming from).

Thanks
Graham
my new motto: Measure twice, cut once.
Graham Mitchell
http://mc3.coop

pbeakley

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Re: Embedded links in CiviMail messages failing
August 30, 2011, 09:59:07 am
So what was the typo? Because I'm getting exactly this issue in 3.3.1.

p.

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Embedded links in CiviMail messages failing
August 30, 2011, 10:48:40 am
Hmm, it's going back a little way now, but it was an embarrassingly simple error, along the lines of http:///foo.bar in a url, or maybe http://www,foo.bar
Small enough for me to miss in at least three close reads-through to try and spot it, convincing me that Civi was at fault and not me, and small enough for Safari to still reach the links correctly.
Graham Mitchell
http://mc3.coop

_the

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7.x
Re: Embedded links in CiviMail messages failing
March 27, 2013, 01:58:14 am
Had the same Problem with an Mailing-Template in civimail and the using of the token {mailing.viewUrl}.

The solution for me was a simple typo, too.
Instead of using href="{mailing.viewURL}" i had to use href={mailing.viewUrl}.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Embedded links in CiviMail messages failing

This forum was archived on 2017-11-26.