我说,如果是供应商,他登录到网站并填写表格,并在提交时向管理员发送电子邮件,但这只会在管理员(收到此人)时添加到“已批准”列表中电子邮件)允许。我想知道如何在电子邮件中发送链接,当该人点击该链接时,它会批准此特定供应商的此表单...目前我有这个:
MailingManager.SendEmail(toAddresses, fromAddress, "Approval", "<a href=http://localhost:53048/Website/Site/PurchasersSuppliers/CreateSuppliers.aspx?SectionID=537 </a>;
This is an email to ask for confirmation, null, templateID);
所以我知道你可以在邮件正文中添加HTML ....但是我如何得到它以便当点击正文中的链接时我得到某种方式向数据库指示是否这样特定记录是否获得批准?
答案 0 :(得分:2)
你可以传递html代码,如下所示
MailingManager.SendEmail(toAddresses, fromAddress, "Approval", "<a href='http://localhost:53048/Website/Site/PurchasersSuppliers/CreateSuppliers.aspx?SectionID=537&UserID=12&SupplierID=2'>This is an email to ask for confirmation </a>", null, templateID);
当您通过邮件发送链接,然后通过供应商打开的电子邮件链接时,它会重定向到您的应用程序页面CreateSuppliers.aspx。
现在在CreateSuppliers.aspx页面上你可以处理页面加载本身的事件。你可以在查询字符串中传递更多的参数来完成你的任务。
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DoSomething(Request["SectionID"]);
}
}
private void DoSomething(string SectionID)
{
// make database call against SectionID and fetch whether its approved or not.
}
希望这会对你有帮助....