How to add url of site in mail

How to add url of site in mail

  
We want to inform a user with a mail that he need to go to the site of the application.
How do I get the URL of the server ?
I know there is GetUrl() but this does not return the server or domainname
I only get the location of the eSpace.

Comparable to what you do with the daily digest, there are links to www.outsystems.com/network and then to specific page.

Hi Joop,

 

To obtain the URL of the server you can use GetURL(), but this will only work if you're making a request to the application, since GetURL action is based on the HTTPRequestHandler. If that is the case - say, you send the email on the click of a button - then don't forget to parse the server from what GetURL() returns.

 

On the other hand, as is the case of the daily digest which is usually initiated by a timer, the URL returned by the HTTP request will always be 127.0.0.1. You have 2 workarounds:

  • Simply create a site property that holds the server name and append it to your email address;
  • If this is an internal application, and all your users are able to access the machine's network name (example: devserver01) then create a new extension that returns the .NET Framework System.Environment.MachineName property and you'll get the server name.

Hope that helps,

Pedro

Hi Joop,

 

In version 4.x, the best way specify the domainname (to pass to richmail, I assume) is to place it in a Site Property and define it once for your application. It is how we handle it for the network forum email notifications.

 

Cheers,

Lúcio Ferrão

@Pedro:

GetURL() doesn't return the domain like http://<server>/<eSpaceName>. It only returns the eSpacename of the application without server/domain name. So we'll end up in using a site property.

Thanks.

Hi Joop,

 

Are you sure you were using GetURL action from HTTPRequestHandler? Maybe it's another version.

Here's a sample eSpace that returns the output from a button submit and from a timer - check out the differences.

 

Cheers,

Pedro

Pedro,

We need to also have this available from a timer ... we solved this by a site property :-)
Thanks
Joop