Exemplo n.º 1
0
        public async Task <string> GetHtmlBodyForMailAsync(ContentReference mailReference, NameValueCollection nameValueCollection,
                                                           string language)
        {
            var urlBuilder = new UrlBuilder(_urlResolver.GetUrl(mailReference, language))
            {
                QueryCollection = nameValueCollection
            };

            var basePath     = _httpContextBase.Request.Host.Value /*.GetLeftPart(UriPartial.Authority)*/;
            var relativePath = urlBuilder.ToString();

            if (relativePath.StartsWith(basePath))
            {
                relativePath = relativePath.Substring(basePath.Length);
            }

            return(await _htmlDownloader.DownloadAsync(basePath, relativePath));
        }