1365
Views
7
Comments
Solved
Getting absolute URL in Email.
Hi All,

I have an email where users can click on a link (this works) but underneath this link I want the URL written down. (so they can copy it in the browser).
I tried using the following 2 functions from the extension HTTPRequestHandler:

MakeAbsoluteURL(GetEntryeSpace(EntryPoint,eSpaceName)) normaly this works perfect.
But in the email I get a local address: 127.0.0.1/eSpace/Entrypoint.jsf

How can I the correct behaviour?

Kind regards,
Martijn Habraken
mvp_badge
MVP
Solution
hi Martijn Habraken,

can u add '
https://" + GetServerName() + "/espacename/xxxx.aspx'as input parameter in email.

eg: add URL as an input parameter in email and use it and set this parameter with above value.

mvp_badge
MVP
hi Martijn Habraken,

You can add the below parameter to var and use it in the email.
"https://" + GetServerName() + "/espacename/xxxx.aspx"
mvp_badge
MVP
Hi Manish Jawla,

Unfortunately, this solutions also results in a local address: 
https://127.0.0.1/espacename/xxxx.asp

I think this happens because sending emails is a asynchronically process.
If I'm not mistaken, the OutSystems platform builds the link URLs as part of the email send process, based on the hostname configured in Service Center (Administration > Environment Configuration).

I'm not aware of any way to get that value, but you can easily replicate that behavior by creating a Site property for your hostname.
mvp_badge
MVP
Solution
hi Martijn Habraken,

can u add '
https://" + GetServerName() + "/espacename/xxxx.aspx'as input parameter in email.

eg: add URL as an input parameter in email and use it and set this parameter with above value.

mvp_badge
MVP
Hi Manish,

Putting the URL as input parameter indeed works.
Thanks.

How can we use this URL in UI Email Interface?

Hi, I know this is very old post, but in case if anyone looking for simple solution: just using built-in link to a screen produces absolute URL. Off course this assumes you have the email and the screen in the same module, but then if you need - you can redirect elsewhere from the screen.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.