public ActionResult Pass(int id) { Comment comment = CommentBll.GetById(id); comment.Status = Status.Pended; Post post = PostBll.GetById(comment.PostId); bool b = CommentBll.UpdateEntitySaved(comment); var pid = comment.ParentId == 0 ? comment.Id : CommentBll.GetParentCommentIdByChildId(id); #if !DEBUG string content = System.IO.File.ReadAllText(Request.MapPath("/template/notify.html")).Replace("{{title}}", post.Title).Replace("{{time}}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")).Replace("{{nickname}}", comment.NickName).Replace("{{content}}", comment.Content); var emails = CommentBll.GetSelfAndAllChildrenCommentsByParentId(pid).Select(c => c.Email).Distinct().Except(new List <string>() { comment.Email, GetSettings("ReceiveEmail") }).ToList(); string link = Url.Action("Details", "Post", new { id = comment.PostId, cid = pid }, Request.Url.Scheme) + "#comment"; foreach (var email in emails) { BackgroundJob.Enqueue(() => SendMail($"{Request.Url.Authority}{GetSettings("Title")}文章评论回复:", content.Replace("{{link}}", link), email)); } #endif return(ResultData(null, b, b ? "审核通过!" : "审核失败!")); }