I recently pushed a site from a staging server to the live server and I can't seem to get the node-url token to update for notifications. I made a copy of the site again and the base url updated to that site fine, but I can't get the main site to update.
As another example I have another site that always sticks www in front of the path for node-url token in notifications, even though I've never set that anywhere.
Does anyone know where this is set / stored? The node-url token is set using: url('node/'. $node->nid, array('absolute' => TRUE));
Is there another way to build that token that would be better?
Comments
Comment #1
sagannotcarl commentedSo I've figured this problem out.
For the first example, the problem was simply that I had set up the cron job while the site was still using a temporary url, and didn't change it when the proper url was set up. When the crontab hit the server it was doing so using the old temporary url so the url() function picked up on that for the token.
That isn't the problem for the second site, but now I realize that people are probably just browsing the site at www. and I'm not. So as long as I force people to not use www then it will all be standardized for the notifications.
Comment #2
pixelpreview@gmail.com commentedit was really a problem in your cron task configuration ?
I have the same problem
I receive email notification without base url
Comment #3
atuline commentedI have an issue similar to #2 above, in that the notification email doesn't contain the base URL in the mail message.
When I receive a notification email, it says:
Read more http:///content/great-article
instead of the full URL, which I would have expected (i.e. http://www.foobar.com/content/great-article )
Funny thing is, it works as expected on a 'Test' content type, but not for my 'Event' content type.
From #1 above, (if I read it right) any content created before the site had its full URL may not work correctly.
Comment #4
TripleEmcoder commentedI have the same problem. This also affects subscription links.
Comment #5
speedyboum commentedsubscribing
Comment #6
seehawk commentedI had the exact same problem as described in #3, and was able to fix it by specifying the base_url in settings.php.
Comment #7
seehawk commentedWait. I lied. It seems to work now for some and not for others. Still looking for a solution
Comment #8
elwood commentedi'm in trouble with this too. Re-created my cron job, still no joy.
Comment #9
StratisFear commentedI found one solution to the missing part of the URL.
Go to your settings.php file, and look for a commented out line with "http://www.example.com" in it. That's where drupal pulls the information from. When I replaced the example.com with my domain, messaging used the right links.
Don't forget to enable the line by removing the commenting.
Comment #10
elwood commentedhas anyone cracked this? i'm pulling my hair out
Comment #11
cnix commentedI'm having the same problem. It seems to work intermittently but lately the links have been broken more often than not. Like #3 my links are sent out without the base URL. This is the case for both the read more and unsubscribe links. Any ideas???
Comment #12
dave reidYou have to make sure to use the $base_url global in your site's settings.php since cron runs run differently from normal browser requests.
See http://drupal.org/node/43619
Comment #13
elwood commentedDave, i think we've all set $base_url in settings.php but are still having problems.
for my email notifications it picks up the $base_url for most links (e.g. unsubscribe at bottom of email etc) but not for the node. It worked at one point but i can't work out what has changed.
Comment #14
elwood commentedcan anyone explain to me how the token [views-items] is generated in a notification email?
thanks
Comment #16
TDobrowolski commentedSo is this problem solved with altering $base_url at settings.php?
Comment #17
TDobrowolski commentedYepp... Didn´t solve the problem for me... What should I do?
Comment #18
caspercash commentedHi drupal users!
I think I have the same problem as this thread. In my email notification, the token [node-url] returns a url that doesn't have the sites domain. So for example if the node-url is http://drupal.org/node/1234, in the email notification, the url becomes http:///node/1234. its as if the base_url drupal.org is stripped from the url. The links displayed in the footer of the email also looks like this:
http:///user/1541/notifications
http:///notifications/unsubscribe/sid/2374?signature=e701349104532fdf859...
Anybody knows how to workaround this problem? I kind of stuck as to how to solve this one. I would really much appreciate any suggestions/solutions to this problem.
Thanks!
Comment #19
caspercash commentedHello! Anyone knows how to fix this? :(
Comment #20
kangnamkid commentedcaspercash,
I couldn't get the [node-url] token to work either. Instead I used two other tokens together that produce the full path -- try [site-url][node-path]. My version is 6.x-4.0-beta7.
Comment #21
caspercash commentedThank you for your reply kangnamkid! But I just recently found the workaround on this problem. What I did was:
Enabled the $base_path and set its value to the sites domain 'http://example.com' in the settings.php file.
Updated the versions of messaging, notifications and token modules. Before it was 6.x-2.2 for messaging and notifications and 6.x-1.13 for token. Now its 6.x-2.x-dev for messaging, 6.x-2.3 for notifications and 6.x-1.18 for token.
Phew..
Thank GOD it was solved. I've been working on it for days now trying to find a solution. I've also tried your suggestion -- [site-url][node-path] -- but it wasn't successful because the domain was still removed from the url. I also tried [site-url]/node/[nid] but wasn't successful neither.
Anyway, thanks for dropping by!