One more question on this one. I'm putting the url into the email body with a variable.
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Which ends up looking like this in the email body:
How can I get the requested url before the login page modifies it? Should look something like: