Exemple #1
0
 private string GetMessage(Entity entity, UserConnection userConnection)
 {
     if (entity.GetTypedColumnValue <bool>("IsHtmlBody"))
     {
         return(userConnection.GetIsFeatureEnabled("DisableEmailDecoding")
                                 ? entity.GetTypedColumnValue <string>("Body")
                                 : HttpUtility.HtmlDecode(entity.GetTypedColumnValue <string>("Body")));
     }
     return(StringUtilities.FormatForHtml(entity.GetTypedColumnValue <string>("Body")));
 }
Exemple #2
0
        /// <summary>
        /// Adds parameters to template <paramref name="links"/>.
        /// </summary>
        /// <param name="links">Template links.</param>
        private static Dictionary <string, string> ModifyTemplateLinks(IEnumerable <string> links)
        {
            var results = new Dictionary <string, string>();

            foreach (string link in links)
            {
                string modifiedLink = link;
                string linkHref     = MailingUtilities.ParseHtmlHrefValue(modifiedLink);
                if (!string.IsNullOrEmpty(linkHref))
                {
                    string decodedLinkHref  = HttpUtility.HtmlDecode(HttpUtility.UrlDecode(linkHref));
                    string modifiedLinkHref = AddParametersToLink(decodedLinkHref);
                    modifiedLink = link.ReplaceFirstInstanceOf(linkHref, HttpUtility.HtmlEncode(modifiedLinkHref));
                }
                results[link] = modifiedLink;
            }
            return(results);
        }
 /// <summary>
 /// Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
 /// </summary>
 /// <param name="value">The string to decode.</param>
 /// <returns>A decoded string.</returns>
 public static string HtmlDecode(this string value)
 {
     return(HttpUtility.HtmlDecode(value));
 }
Exemple #4
0
 /// <summary>
 /// Converts a string that has been HTML-encoded (for HTTP transmission) into a decoded
 /// string.
 /// </summary>
 /// <param name="html">An HTML-encoded string to decode.</param>
 /// <returns>A decoded string.</returns>
 public static string HtmlDecode(string html)
 {
     return(HttpUtilityStd.HtmlDecode(html));
 }