private static void ThreadSendAlerts(Thread parentThread, List<int> alertedUsrs, Usr postingUsr, CommentAlertSet cas, IDiscussable parent) { #region Send alerts if (cas != null) { foreach (CommentAlert ca in cas) { try { if (!alertedUsrs.Contains(ca.UsrK) && postingUsr.K != ca.UsrK) { ThreadUsr tu = parentThread.GetThreadUsr(ca.Usr); tu.ChangeStatus(ThreadUsr.StatusEnum.NewWatchedForumAlert, parentThread.DateTime, false, false); tu.StatusChangeObjectK = ca.ParentObjectK; tu.StatusChangeObjectType = ca.ParentObjectType; tu.Update(null); Mailer usrMail = new Mailer(); usrMail.Subject = postingUsr.NickName + " posts: \"" + parentThread.SubjectSnip(40) + "\""; usrMail.Body += "<h1>" + postingUsr.NickName + " has posted a new topic</h1>"; usrMail.Body += "<p>The subject is: \"" + parentThread.Subject + "\"</p>"; usrMail.Body += "<p>To read and reply, check out the <a href=\"[LOGIN]\">topic page</a>.</p>"; string s = postingUsr.LinkEmail(); usrMail.Body += "<p>" + postingUsr.LinkEmail() + " posted it in the <a href=\"[LOGIN(" + ((IDiscussable)parent).UrlDiscussion() + ")]\">" + ((IName)parent).Name + " forum</a>.</p>"; if (ca.ParentObjectType.Equals(Model.Entities.ObjectType.Photo)) usrMail.Body += "<p>You're watching for comments posted on <a href=\"[LOGIN(" + ca.ParentPhoto.Url() + ")]\">this photo</a>.</p>"; else usrMail.Body += "<p>You're watching all new topics in the <a href=\"[LOGIN(" + ((IDiscussable)ca.ParentObject).UrlDiscussion() + ")]\">" + ((IName)ca.ParentObject).Name + " forum</a>. To stop receiving these emails, click the <i>Ignore new topics in this forum</i> button on the forum page.</p>"; usrMail.TemplateType = Mailer.TemplateTypes.AnotherSiteUser; usrMail.RedirectUrl = parentThread.UrlDiscussion(); usrMail.UsrRecipient = ca.Usr; usrMail.Bulk = true; usrMail.Inbox = true; usrMail.Send(); alertedUsrs.Add(ca.UsrK); } } catch (Exception ex) { Bobs.Global.Log("9a9f2ee1-41ea-4e2b-8187-caa75ddd1b8e - UsrK=" + postingUsr.K.ToString() + " ThreadK=" + parentThread.K.ToString(), ex); } } } #endregion }
public bool SendWelcomeEmail(Usr invitingUsr, Group invitingGroup, string inviteMessage) { if (this.EmailHold) return false; Mailer sm = new Mailer(); sm.UsrRecipient = this; if (invitingGroup == null) { if (invitingUsr == null) { sm.Subject = "We've created you a Don't Stay In account!"; sm.Body = @" <p> Don't Stay In is <i>the</i> place to plan your clubbing calendar. Our team of spotters are busy taking photos of clubbers at the hottest parties in your area and throughout the world. </p> <p> If you've had your photo taken, you can look through our galleries to find it. You can chat live with other clubbers and catch up with the latest gossip. </p> <p align=""center"" style=""margin:10px 0px 8px 0px;""> <a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">Click here to go to DontStayIn</a> </p> "; } else { sm.Subject = invitingUsr.NickName + " has invited you to DontStayIn!"; sm.Body = "<p><b>" + invitingUsr.NickName + @" has invited you to DontStayIn!</b></p> <p> DontStayIn is <i>the</i> place to plan your clubbing calendar. Our team of spotters are busy taking photos of clubbers at the hottest parties in your area and throughout the world. </p> <p> If you've had your photo taken, you can look through our galleries to find it. You can chat live with other clubbers and catch up with the latest gossip. </p> <p align=""center"" style=""margin:10px 0px 8px 0px;""> <a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">Click here to go to DontStayIn</a> </p> "; } } else { GroupUsr invitingGroupUsr = invitingGroup.GetGroupUsr(invitingUsr); sm.RedirectUrl = invitingGroup.Url(); sm.Subject = invitingUsr.NickName + @" has invited you to " + (invitingGroupUsr != null && invitingGroupUsr.Moderator ? invitingUsr.HisString(false) : "a") + @" DontStayIn group: " + invitingGroup.FriendlyName; string pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"">"; string picEnd = "</td></tr></table>"; if (invitingUsr.HasPic) { pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"" style=""padding:0px 10px 0px 0px;"">"; pic += "<a href=\"[LOGIN]\"><img src=\"" + invitingUsr.PicPath + "\" class=\"BorderBlack All\" width=\"100\" height=\"100\" vspace=\"3\" border=\"0\"></a></td><td valign=\"top\">"; picEnd = "</td></tr></table>"; } string members = ""; if (invitingGroup.TotalMembers > 5) { Query q = new Query(); q.TableElement = Usr.GroupJoin; q.QueryCondition = new And(new Q(Group.Columns.K, invitingGroup.K), new Q(Usr.Columns.Pic, QueryOperator.NotEqualTo, Guid.Empty)); q.TopRecords = 5; q.OrderBy = new OrderBy(OrderBy.OrderDirection.Random); q.Columns = Usr.LinkColumns; UsrSet us = new UsrSet(q); if (us.Count == 5) { members = @"<p><b>" + invitingGroup.FriendlyName + @"</b> has " + invitingGroup.TotalMembers.ToString("#,##0") + @" members. Here's a few of them:</p>"; members += @"<table cellspacing=""4"" cellpadding=""4"" border=""0"" width=""100%""><tr>"; foreach (Usr uPic in us) { members += "<td width=\"20%\" valign=\"top\"><center><a href=\"[LOGIN(" + uPic.Url() + ")]\"><img src=\"" + uPic.PicPath + "\" width=\"75\" height=\"75\" style=\"margin:0px 0px 5px 0px;\" class=\"BorderBlack All\"><br>" + Cambro.Misc.Utility.Snip(uPic.NickName, 12) + "</a></center></td>"; } members += @"</tr></table>"; } } sm.Body = @" " + pic + @" <i style=""font-size:18px;""><b>""</b>" + Cambro.Web.Helpers.Strip(inviteMessage, true, true, false, true).Replace("\n", "<br>") + @"<b>""</b></i> " + picEnd + @" <p>" + invitingUsr.LinkEmail() + @" (" + invitingUsr.FirstName + @") has invited you to " + (invitingGroupUsr != null && invitingGroupUsr.Moderator ? invitingUsr.HisString(false) : "a") + @" DontStayIn group! You can use this to keep in contact with your friends. Here's a quick description of <b>" + invitingGroup.FriendlyName + @"</b>:</p> <p> <i>" + invitingGroup.Description + @"</i> </p> " + members + @" "; } sm.Send(); return true; }
public void Join(Usr u, GroupUsr gu) { bool exists = true; if (gu==null) { exists = false; gu = new GroupUsr(); gu.UsrK=u.K; gu.GroupK=this.K; gu.Owner=false; gu.Moderator=false; gu.NewsAdmin=false; gu.MemberAdmin=false; } else { if (gu.Status.Equals(GroupUsr.StatusEnum.Barred) || gu.Status.Equals(GroupUsr.StatusEnum.RequestRejected)) throw new DsiUserFriendlyException("You can't join this group. You have been barred or denied."); } bool joined = false; bool requested = false; if (this.PrivateGroupPage) { if (exists && (gu.Status.Equals(GroupUsr.StatusEnum.Invite) || gu.Status.Equals(GroupUsr.StatusEnum.InviteRejected) || gu.Status.Equals(GroupUsr.StatusEnum.Exited))) { gu.Status=GroupUsr.StatusEnum.Member; gu.StatusChangeDateTime=DateTime.Now; gu.StatusChangeUsrK=u.K; gu.Update(); joined = true; } else throw new DsiUserFriendlyException("You can't request membership of a private group. You must wait to be invited."); } else if (this.Restriction.Equals(Group.RestrictionEnum.None)) { gu.Status=GroupUsr.StatusEnum.Member; gu.StatusChangeDateTime=DateTime.Now; gu.StatusChangeUsrK=u.K; gu.Update(); joined = true; } else if (this.Restriction.Equals(Group.RestrictionEnum.Member) || this.Restriction.Equals(Group.RestrictionEnum.Moderator)) { if (exists && (gu.Status.Equals(GroupUsr.StatusEnum.Invite) || gu.Status.Equals(GroupUsr.StatusEnum.InviteRejected) || gu.Status.Equals(GroupUsr.StatusEnum.Exited))) { gu.Status=GroupUsr.StatusEnum.Member; gu.StatusChangeDateTime=DateTime.Now; gu.StatusChangeUsrK=u.K; gu.Update(); joined = true; } else if ( !exists || exists && (gu.Status.Equals(GroupUsr.StatusEnum.Recommend) || gu.Status.Equals(GroupUsr.StatusEnum.RecommendRejected))) { gu.Status=GroupUsr.StatusEnum.Request; gu.StatusChangeDateTime=DateTime.Now; gu.StatusChangeUsrK=u.K; gu.Update(); requested = true; } else throw new DsiUserFriendlyException("You can't join this group"); } else if (this.Restriction.Equals(Group.RestrictionEnum.Custom)) throw new DsiUserFriendlyException("You can't join this group - it's membership restriction is set to Custom."); if (joined) { this.UpdateTotalMembers(); SendJoinedEmail(u); if (this.K == Vars.CompetitionGroupK) { Log.Increment(Log.Items.CaptionGroupJoin); } Query qAdmin = new Query(); qAdmin.QueryCondition=new And(this.MemberAdminQ, new Q(GroupUsr.Columns.MemberAdminNewUserEmails,true)); qAdmin.TableElement=Group.UsrMemberJoin; qAdmin.Columns=Usr.EmailColumns; UsrSet usAdmins = new UsrSet(qAdmin); foreach (Usr admin in usAdmins) { Mailer mAdmin = new Mailer(); mAdmin.UsrRecipient=admin; mAdmin.Subject="New group member - "+u.NickName+" has joined "+this.FriendlyName; mAdmin.Body="<p>" + u.LinkEmail() + " has joined the "+ this.FriendlyName+" group.</p>"; mAdmin.Body += "<p><b>Did you know you can turn these emails off?</b> Check out your <a href=\"[LOGIN]\">group membership moderator options</a>.</p>"; mAdmin.RedirectUrl=this.UrlApp("admin","mode","membership"); mAdmin.Send(); } if (!this.PrivateGroupPage && u.FacebookConnected && u.FacebookStoryJoinGroup) { try { FacebookPost.CreateJoinGroup(u, this); } catch { } } } else if (requested) { this.UpdateTotalMembers(); string alertScope="when news is posted"; if (this.EmailOnAllThreads) alertScope="each time anyone posts a new topic"; Mailer m = new Mailer(); m.UsrRecipient=u; m.Subject="Group membership requested - "+this.FriendlyName; m.Body="<p>You've requested to join the "+this.FriendlyName+" group. The group moderator "+ "has been sent an email and will deal with your application shortly.</p>"+ "<p>If you're accepted as a member, you will receive email alerts "+ alertScope+" in this group. If you ever want to exit the group, click the button "+ "on the <a href=\"[LOGIN("+this.Url()+")]\">group homepage</a>.</p>"; m.RedirectUrl=this.Url(); m.Send(); Query qAdmin = new Query(); qAdmin.QueryCondition=this.MemberAdminQ; qAdmin.TableElement=Group.UsrMemberJoin; qAdmin.Columns=Usr.EmailColumns; UsrSet usAdmins = new UsrSet(qAdmin); foreach (Usr admin in usAdmins) { Mailer mAdmin = new Mailer(); mAdmin.UsrRecipient=admin; mAdmin.Subject="Group membership requested - "+u.NickName+" would like to join "+this.FriendlyName; mAdmin.Body="<p>" + u.LinkEmail() + " would like to join the "+ this.FriendlyName+" group. Please deal with this request as soon as possible. You can accept or deny the "+ "request on the <a href=\"[LOGIN]\">group options page</a>.</p>"; mAdmin.RedirectUrl=this.UrlApp("admin","mode","membership"); mAdmin.Send(); } } }
private void InvitePrivate(Usr InvitedUsr, GroupUsr InvitedGroupUsr, Usr InvitingUsr, GroupUsr InvitingGroupUsr, string InviteMessage) { string inviteMessageStripped = Cambro.Web.Helpers.Strip(InviteMessage,true,true,false,true); if (InvitedGroupUsr==null) { InvitedGroupUsr = new GroupUsr(); InvitedGroupUsr.UsrK = InvitedUsr.K; InvitedGroupUsr.GroupK = this.K; } InvitedGroupUsr.Status = GroupUsr.StatusEnum.Invite; InvitedGroupUsr.StatusChangeDateTime = DateTime.Now; InvitedGroupUsr.StatusChangeUsrK = InvitingUsr.K; if (InvitedGroupUsr.InviteUsrK==0) { InvitedGroupUsr.InviteUsrK = InvitingUsr.K; InvitedGroupUsr.InviteMessage = inviteMessageStripped; } else if (InvitedGroupUsr.InviteUsrK != InvitingUsr.K) { //already had an inviting usr InvitingUsr = InvitedGroupUsr.InviteUsr; InvitingGroupUsr = GetGroupUsr(InvitingUsr); InviteMessage = InvitedGroupUsr.InviteMessage; inviteMessageStripped = Cambro.Web.Helpers.Strip(InviteMessage, true, true, false, true); } if (InvitedUsr.AddedByGroupK!=this.K) { string messageString = ""; if (InviteMessage.Length>0) messageString = "</p><p>"+InvitedGroupUsr.InviteUsr.LinkEmail()+" left you this messsage:</p><p><b>"+inviteMessageStripped+"</b></p><p>"; Mailer sm = new Mailer(); sm.UsrRecipient = InvitedUsr; sm.RedirectUrl = this.Url(); sm.Subject = InvitingUsr.NickName + @" has invited you to " + (InvitingGroupUsr!=null && InvitingGroupUsr.Moderator ? InvitingUsr.HisString(false) : "a") + @" group: " + this.FriendlyName; string pic = "<p>"; string picEnd = "</p>"; if (InvitingUsr.HasPic) { pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"" style=""padding:0px 10px 0px 0px;"">"; pic += "<a href=\"[LOGIN(" + InvitingUsr.Url() + ")]\"><img src=\"" + InvitingUsr.PicPath + "\" class=\"BorderBlack All\" width=\"100\" height=\"100\" vspace=\"3\" border=\"0\"></a></td><td valign=\"top\">"; picEnd = "</td></tr></table>"; } string members = ""; if (this.TotalMembers>5) { Query q = new Query(); q.TableElement = Usr.GroupJoin; q.QueryCondition = new And(new Q(Group.Columns.K, this.K), new Q(Usr.Columns.Pic,QueryOperator.NotEqualTo,Guid.Empty)); q.TopRecords=5; q.OrderBy=new OrderBy(OrderBy.OrderDirection.Random); q.Columns=Usr.LinkColumns; UsrSet us = new UsrSet(q); if (us.Count==5) { members = @"<p><b>"+this.FriendlyName+@"</b> has "+this.TotalMembers.ToString("#,##0")+@" members. Here's a few of them:</p>"; members += @"<table cellspacing=""4"" cellpadding=""4"" border=""0"" width=""100%""><tr>"; foreach (Usr uPic in us) { members += "<td width=\"20%\" valign=\"top\"><center><a href=\"[LOGIN(" + uPic.Url() + ")]\"><img src=\"" + uPic.PicPath + "\" width=\"75\" height=\"75\" style=\"margin:0px 0px 5px 0px;\" class=\"BorderBlack All\"><br>" + Cambro.Misc.Utility.Snip(uPic.NickName, 12) + "</a></center></td>"; } members += @"</tr></table>"; } } string inviteMessage = ""; if (Cambro.Web.Helpers.Strip(InviteMessage,true,true,true,true).Length==0) inviteMessage = "Hi!"; else inviteMessage = Cambro.Web.Helpers.Strip(InviteMessage,true,true,false,true).Replace("\n","<br>"); sm.Body=@" "+pic+@" <i style=""font-size:18px;""><b>""</b>"+inviteMessage+@"<b>""</b></i> "+picEnd+@" <p>" + InvitingUsr.LinkEmail() + @" has invited you to " + (InvitingGroupUsr != null && InvitingGroupUsr.Moderator ? InvitingUsr.HisString(false) : "a") + @" group! You can use this to keep in contact with your friends. Here's a quick description of <b>" +this.FriendlyName+@"</b>:</p> <p> <i>"+this.Description+@"</i> </p> "+members+ @" <p align=""center"" style=""margin:10px 0px 8px 0px;""> <a href=""[LOGIN("+this.UrlApp("join")+@")]"" style=""font-size:18px;font-weight:bold;"">Join the group</a> | <a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">decline the invite</a> </p> "; sm.Send(); } InvitedGroupUsr.Update(); }
public Return InviteReject(Usr TargetUsr, GroupUsr TargetGroupUsr) { Return r = new Return(); if (this.Restriction.Equals(Group.RestrictionEnum.Custom)) { r.Success=false; r.MessageHtml="The "+this.FriendlyName+" group is a special group - the membership "+ "is automatically controlled. You can't decline an invite to this group."; return r; } if (TargetGroupUsr==null) { r.Success=false; r.MessageHtml="You haven't been invited to the "+this.FriendlyName+" group!"; return r; } else if (TargetGroupUsr.Status.Equals(GroupUsr.StatusEnum.Invite)) { TargetGroupUsr.Status = GroupUsr.StatusEnum.InviteRejected; TargetGroupUsr.StatusChangeDateTime = DateTime.Now; TargetGroupUsr.StatusChangeUsrK = TargetUsr.K; GroupUsr gu = this.GetGroupUsr(TargetGroupUsr.InviteUsr); if (gu.MemberAdminNewUserEmails) { Mailer m = new Mailer(); m.UsrRecipient = TargetGroupUsr.InviteUsr; m.Subject = "Your invitation for " + TargetUsr.NickName + " to join the " + this.FriendlyName + " group has been rejected."; m.Body = "<p>Your invitation for " + TargetUsr.LinkEmail() + " to join the " + this.FriendlyName + " group has been rejected. " + TargetUsr.LinkEmail() + " did not want to join the group.</p>"; m.RedirectUrl = TargetUsr.Url(); m.Send(); } TargetGroupUsr.Update(); r.Success=true; return r; } else { r.Success=false; r.MessageHtml="You haven't been invited to the "+this.FriendlyName+" group!"; return r; } }
public void UnBar(Usr TargetUsr, GroupUsr TargetGroupUsr, Usr PerformingUsr, GroupUsr PerformingGroupUsr) { if (this.Restriction.Equals(Group.RestrictionEnum.Custom)) throw new DsiUserFriendlyException("Can't unbar from a custom group!"); if (!PerformingUsr.IsAdmin && (PerformingGroupUsr==null || !PerformingGroupUsr.MemberAdmin)) throw new DsiUserFriendlyException("You must be a membership admin of this group to unbar someone!"); if (TargetGroupUsr!=null && TargetGroupUsr.Status.Equals(GroupUsr.StatusEnum.Barred)) { TargetGroupUsr.Status = GroupUsr.StatusEnum.Invite; TargetGroupUsr.StatusChangeDateTime = DateTime.Now; TargetGroupUsr.StatusChangeUsrK = PerformingUsr.K; Query qAdmin = new Query(); qAdmin.QueryCondition=this.MemberAdminQ; qAdmin.TableElement=Group.UsrMemberJoin; qAdmin.Columns=Usr.EmailColumns; UsrSet usAdmins = new UsrSet(qAdmin); foreach (Usr admin in usAdmins) { Mailer mAdmin = new Mailer(); mAdmin.UsrRecipient=admin; mAdmin.Subject="Member un-barred - "+TargetUsr.NickName+" has been un-barred from the "+ this.FriendlyName+ " group by "+PerformingUsr.NickName; mAdmin.Body="<p>"+TargetUsr.LinkEmail()+" has been un-barred from the "+ this.FriendlyName+ " group by "+PerformingUsr.LinkEmail()+"</p>"; mAdmin.RedirectUrl=this.UrlApp("admin","mode","membership"); mAdmin.Send(); } Mailer m = new Mailer(); m.UsrRecipient = TargetUsr; m.Subject = "You have been un-barred from the the "+this.FriendlyName+" group."; m.Body = "<p>You have been un-barred from the the "+this.FriendlyName+" group. You may join the group by clicking the button on the group homepage. You can contact a group moderator for more information.</p>"; m.RedirectUrl = this.Url(); m.Send(); TargetGroupUsr.Update(); } }
public void Bar(Usr TargetUsr, GroupUsr TargetGroupUsr, Usr PerformingUsr, GroupUsr PerformingGroupUsr) { if (this.Restriction.Equals(Group.RestrictionEnum.Custom)) throw new DsiUserFriendlyException("Can't bar from a custom group!"); if (!PerformingUsr.IsAdmin && (PerformingGroupUsr==null || !PerformingGroupUsr.MemberAdmin)) throw new DsiUserFriendlyException("You must be a membership admin of this group to bar someone!"); if (TargetGroupUsr!=null && TargetGroupUsr.Status.Equals(GroupUsr.StatusEnum.Barred)) { } else { if (TargetGroupUsr==null) { TargetGroupUsr = new GroupUsr(); TargetGroupUsr.UsrK = TargetUsr.K; TargetGroupUsr.GroupK = this.K; } else if (TargetGroupUsr.Moderator) throw new DsiUserFriendlyException("You can't bar this person - they are a moderator. First remove their moderator status before banning them."); TargetGroupUsr.Status = GroupUsr.StatusEnum.Barred; TargetGroupUsr.StatusChangeDateTime = DateTime.Now; TargetGroupUsr.StatusChangeUsrK = PerformingUsr.K; Query qAdmin = new Query(); qAdmin.QueryCondition=this.MemberAdminQ; qAdmin.TableElement=Group.UsrMemberJoin; qAdmin.Columns=Usr.EmailColumns; UsrSet usAdmins = new UsrSet(qAdmin); foreach (Usr admin in usAdmins) { Mailer mAdmin = new Mailer(); mAdmin.UsrRecipient=admin; mAdmin.Subject="Member barred - "+TargetUsr.NickName+" has been barred from the "+ this.FriendlyName+ " group by "+PerformingUsr.NickName; mAdmin.Body="<p>"+TargetUsr.LinkEmail()+" has been barred from the "+ this.FriendlyName+ " group by "+PerformingUsr.LinkEmail()+"</p>"; mAdmin.RedirectUrl=this.UrlApp("admin","mode","membership"); mAdmin.Send(); } Mailer m = new Mailer(); m.UsrRecipient = TargetUsr; m.Subject = "You have been barred from the the "+this.FriendlyName+" group."; m.Body = "<p>You have been barred from the the "+this.FriendlyName+" group. You can contact a group moderator for more information.</p>"; m.RedirectUrl = this.Url(); m.Send(); TargetGroupUsr.Update(); CommentAlert.Disable(TargetUsr, this.K, Model.Entities.ObjectType.Group); } }
private void RejectPrivate(Usr RejectedUsr, GroupUsr RejectedGroupUsr, Usr PerformingUsr, GroupUsr PerformingGroupUsr) { if (RejectedUsr==null) { throw new Exception("InvitedGroupUsr is null!"); } if (RejectedGroupUsr.Status.Equals(GroupUsr.StatusEnum.Request)) RejectedGroupUsr.Status = GroupUsr.StatusEnum.RequestRejected; else if (RejectedGroupUsr.Status.Equals(GroupUsr.StatusEnum.Recommend)) RejectedGroupUsr.Status = GroupUsr.StatusEnum.RecommendRejected; else throw new Exception("Incorrect status to reject!"); RejectedGroupUsr.StatusChangeDateTime = DateTime.Now; RejectedGroupUsr.StatusChangeUsrK=PerformingUsr.K; if (RejectedGroupUsr.Status.Equals(GroupUsr.StatusEnum.RequestRejected)) { Mailer m = new Mailer(); m.UsrRecipient = RejectedUsr; m.Subject = "Your request to join the "+this.FriendlyName+" group has been rejected."; m.Body = "<p>Your request to join the "+this.FriendlyName+" group has been rejected. You can contact a group moderator for more information.</p>"; m.RedirectUrl = this.Url(); m.Send(); } else if (RejectedGroupUsr.Status.Equals(GroupUsr.StatusEnum.RecommendRejected)) { Mailer m = new Mailer(); m.UsrRecipient = RejectedGroupUsr.InviteUsr; m.Subject = "Your recommendation for "+RejectedUsr.NickName+" to join the "+this.FriendlyName+" group has been rejected."; m.Body = "<p>Your recommendation for "+RejectedUsr.LinkEmail()+" to join the "+this.FriendlyName+" group has been rejected. You can contact a group moderator for more information.</p>"; m.RedirectUrl = this.Url(); m.Send(); } RejectedGroupUsr.Update(); }
private void RecommendPrivate(Usr InvitedUsr, GroupUsr InvitedGroupUsr, Usr InvitingUsr, GroupUsr InvitingGroupUsr, string InviteMessage) { if (InvitedGroupUsr==null) { InvitedGroupUsr = new GroupUsr(); InvitedGroupUsr.UsrK = InvitedUsr.K; InvitedGroupUsr.GroupK = this.K; } InvitedGroupUsr.Status = GroupUsr.StatusEnum.Recommend; InvitedGroupUsr.StatusChangeDateTime = DateTime.Now; InvitedGroupUsr.StatusChangeUsrK = InvitingUsr.K; if (InvitedGroupUsr.InviteUsrK==0) { InvitedGroupUsr.InviteUsrK = InvitingUsr.K; InvitedGroupUsr.InviteMessage = InviteMessage; } Query qAdmin = new Query(); qAdmin.QueryCondition=this.MemberAdminQ; qAdmin.TableElement=Group.UsrMemberJoin; qAdmin.Columns=Usr.EmailColumns; UsrSet usAdmins = new UsrSet(qAdmin); foreach (Usr admin in usAdmins) { Mailer mAdmin = new Mailer(); mAdmin.UsrRecipient=admin; mAdmin.Subject="Group membership recommended - "+InvitedUsr.NickName+" has been recommended "+ "by "+InvitingUsr.NickName+" as a member of "+this.FriendlyName; mAdmin.Body="<p>"+InvitedUsr.LinkEmail()+" has been recommended "+ "by "+InvitingUsr.LinkEmail()+" as a member of the "+this.FriendlyName+ " group. Please deal with this request as soon as possible. You can accept or deny the request "+ "on the <a href=\"[LOGIN]\">group options page</a>.</p>"; mAdmin.RedirectUrl=this.UrlApp("admin","mode","membership"); mAdmin.Send(); } InvitedGroupUsr.Update(); }