Original URL is not changing with respect to Environment

Hi,

I am using the rule APN_getSiteUrl, to get the environment specified URL.  But when user places cursor on the link that received in the mail, is showing original url as DEV instead of TEST.  

Can any one help on this?

In Dev:

In TEST:

But in email : 

  Discussion posts and replies are publicly visible