如果符合其搜索条件,请通知用户

时间:2018-04-17 08:11:45

标签: c# asp.net asp.net-mvc

我使用asp.net mvc开发销售系统。我的搜索系统允许用户保存他们的搜索条件,并在发布新产品时通过电子邮件通知他们符合他们的标准。我尝试了以下方法:

第一种方式:创建一个通过gmail发送批量邮件的功能,我把这个功能放在post函数中。您可以看到下面描述的代码,以了解我所说的内容:

public ActionResult PostProduct()
{ 
  ....
  var list = Check(); // get a list of user email when their search criteria are met with the posted product
  Send(list); // send email to the list
  // I don't know how long does it take to complete this function?
}

然而,这种方法需要来自服务器的大量资源并且需要花费大量时间来响应(如果电子邮件数量高达1000,这将是一件坏事),但我可以将参数自定义为电子邮件内容(例如链接,图像......)

第二种方式:我使用邮件服务(MailChimp),我成功调用了它的API,发送邮件似乎很容易,但我无法调整输入参数。这意味着我无法自定义电子邮件的内容。 我想问一下人们是否有比以往更好更明智的做事方式。感谢阅读

0 个答案:

没有答案