首页 文章

电子邮件与批准链接

提问于
浏览
1

我有一个供应商说,他登录到网站并填写表格,并在提交时向管理员发送电子邮件,但只有当管理员(收到此电子邮件的人)允许时才会将其添加到“已批准”列表中 . 我想知道如何在电子邮件中发送链接,当该人点击该链接时,它会为此特定供应商批准此表单...目前我有这样的信息:

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到邮件的正文....但我如何得到它,以便当点击正文中的链接时,我得到某种方式向数据库指示此特定记录是否是是否批准?

1 回答

  • 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.
    }
    

    希望这会对你有所帮助....

相关问题