We have a Sitecore installation with a content management server and a content delivery server.
Now: I have an item, for which I want to create a link (for sending in an email). The link should be created on the CM server, but point to the relevant page on the CD server.
The servers are on different domain, why it doesn't make sense to send the CM link.
Currently my endeavors are as follows:
string oldSiteName = Sitecore.Context.GetSiteName();
Sitecore.Context.SetActiveSite("website");
UrlOptions urlOptions = new UrlOptions
{
AlwaysIncludeServerUrl = true,
SiteResolving = true
};
string link = LinkManager.GetItemUrl(item, urlOptions);
Sitecore.Context.SetActiveSite(oldSiteName);
This, however, still generates links to the CM domain.
Edit: I added a part of the source code I forgot when first creating the post