Reminder email links don't have the site's domain

hawkdrupal - April 7, 2008 - 03:49
Project:Account reminder
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The emails send by Account reminder, latest 5.x-1.x-dev, contain links that don't have the domain, so they don't work.

For instance, here's a unsubscribe link from the email:
http:///account-reminder/521/ff305c0e051f38e62a6d109ed14d7bc5

NO DOMAIN!

The reminder email has three links where the domain needs to be included, but it's blank, same as the above example.

I know about the !/% situation, but it's not a problem in my situation. The %variables in the email work correctly. But the domain portion of a link, along with http:// prefix, is not controlled by me, it's built into the module. Why is it blank?

I don't know where this module gets the domain, but it's getting a blank value right now.

The site has the full domain in Site Information and other normal places, and otherwise works perfectly (and has been for a year).

After this version of the module was installed, Update was run and there were no errors reported.

So, maybe there's one more place to specify the site's domain, or this module is not looking in the right place, or what?

#1

jaydub - April 7, 2008 - 04:10

Not sure why that happens for you, it works ok for me...the code to generate that
URL uses the Drupal url() function. The last parameter for the function tells Drupal
to create and absolute link which will add in the site domain.

See http://api.drupal.org/api/function/url/5 and the code in account_reminder:

function account_reminder_unsubscribe_url($user) {
  return url("account-reminder/". $user->uid ."/". md5($user->uid . $user->pass), NULL, NULL, TRUE);
}

Can you test out creating your own link via the url() function to test your
setup? If the output for url() works as intended for me but not for you
then you'll have to verify that the problem is not with your setup and
url().

#2

hawkdrupal - April 7, 2008 - 15:35

Thanks for the response.

I don't know how to be sure url() function is working, but I have other email modules that send links and they all include the correct, complete domain. I don't know how they differ from Reminder module in determining the domain.

Also, I don't know where the domain is derived for url(), but I can't find any place in Drupal or Apache (.htaccess, etc) where it's blank, and no instance where other links aren't correct and complete. For instance, the initial confirmation email sent by Drupal's user registration has the correct link. I'm stumped because the problem only appears in the follow-up emails sent by Reminder module.

Possibly the module is pulling the domain from a place where it is blank at this point in the user registration process?

That said, it could be a nice enhancement if the module gave the admin total control over the links it emails. Right now I can control the path but not the domain portion of links. Could it be possible to let the admin just type in the desired "http://whatever.com/" before the login_uri variable and not have the module try to add the protocol+domain? And/or allow the admin to specify the desired domain as a variable that can then be used in the text?

#3

hawkdrupal - April 10, 2008 - 17:08

Solution found:

Drupal's settings.php has an OPTIONAL setting, $base_url. Drupal says it is OPTIONAL, but adding it, specifying the site's main domain, fixed the problem of the missing from links in Reminder email. So apparently this is where the url() function gets its value.

#4

jaydub - April 18, 2008 - 03:26
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.