當前位置: 首頁>>代碼示例>>C#>>正文


C# SendGridMessage.DisableClickTracking方法代碼示例

本文整理匯總了C#中SendGrid.SendGridMessage.DisableClickTracking方法的典型用法代碼示例。如果您正苦於以下問題:C# SendGridMessage.DisableClickTracking方法的具體用法?C# SendGridMessage.DisableClickTracking怎麽用?C# SendGridMessage.DisableClickTracking使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SendGrid.SendGridMessage的用法示例。


在下文中一共展示了SendGridMessage.DisableClickTracking方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DisableClickTracking

        public void DisableClickTracking()
        {
            var header = new Header();
            var sendgrid = new SendGridMessage(header);

            sendgrid.DisableClickTracking();

            var json = header.JsonString();
            Assert.AreEqual("{\"filters\" : {\"clicktrack\" : {\"settings\" : {\"enable\" : \"0\"}}}}", json);
        }
開發者ID:npadmanabhan,項目名稱:sendgrid-csharp,代碼行數:10,代碼來源:TestSendgrid.cs

示例2: BuildEmail

        private static SendGridMessage BuildEmail(string name, string email, string link, string otherName)
        {
            var msg = new SendGridMessage();
            msg.EnableTemplateEngine("5f7c4376-3b0c-4972-9049-ee13ef5b59af");
            msg.DisableClickTracking();
            msg.From = new MailAddress("[email protected]", "OkBoba 郵件");
            msg.To = new MailAddress[] { new MailAddress(email, name) };
            msg.Subject = string.Format(i18n.Messaging_Notification_Subject, otherName);
            msg.Html = string.Format(i18n.Messaging_Notification_Body, otherName);

            msg.AddSubstitution("-link-", new List<string>() { link });

            return msg;
        }
開發者ID:jonathan82,項目名稱:okboba,代碼行數:14,代碼來源:Program.cs

示例3: SendAsync

            public Task SendAsync(IdentityMessage message)
            {
                var sgMessage = new SendGridMessage { From = new MailAddress("[email protected]", "Voat") };
                
                sgMessage.AddTo(message.Destination);
                sgMessage.Subject = message.Subject;
                sgMessage.Html = message.Body;
                sgMessage.Text = message.Body;
                
                sgMessage.DisableClickTracking();
                sgMessage.DisableOpenTracking();

                var transportWeb = new Web(Settings.EmailServiceKey);
                return transportWeb.DeliverAsync(sgMessage);
            }
開發者ID:CuteThalia,項目名稱:voat,代碼行數:15,代碼來源:IdentityConfig.cs

示例4: Test_DisablingClickTracking

        public void Test_DisablingClickTracking()
        {
            var mail = BasicMailBuilder
                .DisableClickTracking()
                .Build();

            var message = new SendGridMessage();
            message.DisableClickTracking();
            Assert.IsFalse(string.IsNullOrEmpty(message.Header.JsonString()));
            Assert.AreEqual(message.Header.JsonString(), mail.Header.JsonString());
        }
開發者ID:saluce65,項目名稱:sendgrid-csharp-mailbuilder,代碼行數:11,代碼來源:UnitTest1.cs


注:本文中的SendGrid.SendGridMessage.DisableClickTracking方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。