C# 如何在C中使用SendGrid Api替换按钮链接

C# 如何在C中使用SendGrid Api替换按钮链接,c#,sendgrid,C#,Sendgrid,我的SendGrid帐户中有一个事务性模板,我学会了如何使用它,基本上,我要更改的任何html标记都可以这样做: msg.SetTemplateId("0000000-00000-00000-0000-0000000"); msg.AddSubstitution("-name-", "Example User"); msg.AddSubstitution("-city-", "Denver"); 问题是,如果我必须在一个按钮里面放一个链接,我会怎么做 <a href="http://ww

我的SendGrid帐户中有一个事务性模板,我学会了如何使用它,基本上,我要更改的任何html标记都可以这样做:

msg.SetTemplateId("0000000-00000-00000-0000-0000000");
msg.AddSubstitution("-name-", "Example User");
msg.AddSubstitution("-city-", "Denver");
问题是,如果我必须在一个按钮里面放一个链接,我会怎么做

<a href="http://www.MyCustomLink.com/"><button style="color:#607D8B; background-
color: white;
border: none;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
padding: 15px 32px;"
type="button">Confirm Account</button>

您应该能够简单地将href的值设置为替换键

例如:

<a href="-accountConfirmationLink-">
    <button>Confirm Account</button>
</a>

谢谢,成功了!
msg.AddSubstitution("-accountConfirmationLink-", "https://stackoverflow.com");