URL in email body is getting overridden
Question

I am supporting a site which is configured to send emails in which the body of the message includes a link to the site. The email construction is simple; we have a header, then a single Expression, set to an input parameter which we are using to pass the email body as an HTML string (we encapsulate the parameter in a SanitizeHTML function call). The HTML we're passing looks something like this:

<div>
    <p>" + Trim("Hello " + User.Name) + ",</p>
    <br>
    <p>This profile was escalated to you by " + FromUsersName + ", as it needs management review.</p>
    <p>The details are in the link below:</p>
    <br>
    <p><a href=""" + URL + """>" + URL + "</a></p>
</div>

The variable "URL" is based on a site property.

This is working correctly in our pre-production environments, but in our production environment we have multiple servers, and while the displayed link in the email is correct, if you click the URL it tries to use the domain name of the deployment controller for the environment. This fails, because we've got the application deployed to a deployment zone that the deployment controller is not in.

It's worth noting that in our other deployment zones we do not have this issue, despite using the same approach.

Any ideas on what might be happening here, and how this can be resolved?

Thanks!
Kirk

Champion

HI Kirk

Sorry, I don't understand what's mean by "if you click the URL it tries to use the domain name of the deployment controller for the environment ",

Because your URL is defined in a site property, So it's fixed, right?

Please provide the URL  value you passed.

Kind regards,


For example, the URL we set is something like:

https://mydomainname.com/SiteName/Profile.aspx?profileId=123456

And in the email, that is what displays in the text, but the actual URL it takes you to is something like:

https://SERVER101.com/SiteName/Profile.aspx?profileid=123456

...where SERVER101.com is the domain controller for the Prod environment.

I should mention we're using on prem infrastructure.

Champion

Hi Kirk,

Ok, I understand now.

I think it's not the Outsystems application's problem. It seems somehow your mydomainname.com map to the SERVER101.com in the particular development zone.

Can you try the ping or the nslookup command, or just type the URL(https://mydomainname.com/ )  in your browser to see what happens.

Kind regards

No, I can positively confirm that is not the issue. mydomainname.com resolves to a load balancer for the two machines in the zone to which the application was deployed. It does not resolve to that server.

Furthermore, I can confirm that when you hover over the URL in the email body, it shows the URL as https://SERVER101.com/SiteName/Profile.aspx?profileid=123456, not https://mydomainname.com/SiteName/Profile.aspx?profileId=123456. At some point, the domain name in the URL we are setting is getting replaced with that server name.

Kirk

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