Пример #1
0
        public void EnableBcc(string email)
        {
            var filter = Filters["Bcc"];

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "email"
            }, email);
        }
Пример #2
0
        public void EnableUnsubscribe(string replace)
        {
            var filter = Filters["Unsubscribe"];

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "replace"
            }, replace);
        }
Пример #3
0
        public void EnableFooter(string text = null, string html = null)
        {
            var filter = Filters["Footer"];

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "text/plain"
            }, text);
            Header.AddFilterSetting(filter, new List <string> {
                "text/html"
            }, html);
        }
Пример #4
0
        public void EnableSpamCheck(int score = 5, string url = null)
        {
            var filter = Filters["SpamCheck"];

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "maxscore"
            }, score.ToString(CultureInfo.InvariantCulture));
            Header.AddFilterSetting(filter, new List <string> {
                "url"
            }, url);
        }
Пример #5
0
        public void EnableClickTracking(bool includePlainText = false)
        {
            var filter = Filters["ClickTracking"];

            Header.EnableFilter(filter);
            if (includePlainText)
            {
                Header.AddFilterSetting(filter, new List <string> {
                    "enable_text"
                }, "1");
            }
        }
Пример #6
0
        public void EnableTemplate(string html)
        {
            var filter = Filters["Template"];

            if (!Regex.IsMatch(html, ReHtml))
            {
                throw new Exception("Missing substitution replacementTag in html");
            }

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "text/html"
            }, html);
        }
Пример #7
0
        public void EnableGoogleAnalytics(string source, string medium, string term, string content = null,
                                          string campaign = null)
        {
            var filter = Filters["GoogleAnalytics"];

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "utm_source"
            }, source);
            Header.AddFilterSetting(filter, new List <string> {
                "utm_medium"
            }, medium);
            Header.AddFilterSetting(filter, new List <string> {
                "utm_term"
            }, term);
            Header.AddFilterSetting(filter, new List <string> {
                "utm_content"
            }, content);
            Header.AddFilterSetting(filter, new List <string> {
                "utm_campaign"
            }, campaign);
        }
Пример #8
0
        public void EnableUnsubscribe(string text, string html)
        {
            var filter = Filters["Unsubscribe"];

            if (!Regex.IsMatch(text, ReText))
            {
                throw new Exception("Missing substitution replacementTag in text");
            }

            if (!Regex.IsMatch(html, ReHtml))
            {
                throw new Exception("Missing substitution replacementTag in html");
            }

            Header.EnableFilter(filter);
            Header.AddFilterSetting(filter, new List <string> {
                "text/plain"
            }, text);
            Header.AddFilterSetting(filter, new List <string> {
                "text/html"
            }, html);
        }
Пример #9
0
 public void EnableBypassListManagement()
 {
     Header.EnableFilter(Filters["BypassListManagement"]);
 }
Пример #10
0
 public void EnableOpenTracking()
 {
     Header.EnableFilter(Filters["OpenTracking"]);
 }
Пример #11
0
 public void EnableGravatar()
 {
     Header.EnableFilter(Filters["Gravatar"]);
 }