Getting app comple URL based on the environment

I'm building an email with a URL on it that change depending on the environment I'm at. For example http://localhost:3000/demo on development and .xyz Domain Names | Join Generation XYZ on production.

Is there any environment variable or method that could tell me the complete URL of my web application? I'm looking for an alternative to environment config files.

request.domain in your controller should do it