Quick explanation to why IP address shows up instead of domain name.
That letter uses tokens to place actual information at the run time. For example, it uses [User:FirstName] to insert that particular user's first name (surprized?) URL is also inserted on the spot - and it uses the portal alias that is currently in use. So if you are testing your site using IP address and you'll go and register, that IP address will show up in the email as Portal URL. If you were on one of your actual domain names, then that one would've showed up.
So, if you have multiple domain names pointing to the site but what only a specific one to be the one showing up in email, then hardcode that URL into your email text. Otherwise, keep it dynamic as it is now.