本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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());
}