예제 #1
0
        /// <summary>
        /// Adds links for the RSS and Atom feed to the head section to make the avaliable for subscription.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            HtmlLink link      = new HtmlLink();
            string   url       = CreateExternalLinkInternal(CurrentPage);
            string   separator = "?";

            if (url.Contains("?"))
            {
                separator = "&";
            }

            link.Href = String.Format("{0}{1}feed=RSS", url, separator);
            link.Attributes.Add("rel", "alternate");
            link.Attributes.Add("type", "application/rss+xml");
            link.Attributes.Add("title", String.Format("RSS {0} ", CurrentPage.PageName));
            Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = String.Format("{0}{1}feed=Atom", url, separator);
            link.Attributes.Add("rel", "alternate");
            link.Attributes.Add("type", "application/atom+xml");
            link.Attributes.Add("title", String.Format("Atom {0} ", CurrentPage.PageName));
            Header.Controls.Add(link);

            WorkroomPageBase.InitializeWorkroomPage(this);
            base.OnLoad(e);
        }
예제 #2
0
        /// <summary>
        /// Sends the notification e-mail
        /// </summary>
        /// <param name="workroom">Workroom to invite user to</param>
        /// <param name="userName">Name of user to invite</param>
        /// <param name="eMail">Invited user e-mail</param>
        /// <param name="memberLevel">Invited user member level</param>
        public void Send(WorkroomPageBase workroom, string userName, string email, MembershipLevels memberLevel)
        {
            WorkroomPage = workroom;
            UserName     = userName;
            EmailTo      = email;
            MemberLevel  = memberLevel;

            MailMessage message = GetMessage();

            SmtpClient smtpClient = new SmtpClient();

            smtpClient.Send(message);
        }
예제 #3
0
        /// <summary>
        /// Sends the notification to specified member.
        /// </summary>
        /// <param name="workroom">The workroom.</param>
        /// <param name="member">The member.</param>
        public void Send(WorkroomPageBase workroom, MembershipEntry member)
        {
            WorkroomPage = workroom;
            UserName     = member.Name;
            FirstName    = member.FirstName;
            LastName     = member.LastName;
            EmailTo      = member.Email;
            MemberLevel  = member.Membership;

            MailMessage message = GetMessage();

            SmtpClient smtpClient = new SmtpClient();

            smtpClient.Send(message);
        }
예제 #4
0
 /// <summary>
 /// Handles on load event
 /// </summary>
 /// <param name="e">Event parameters</param>
 protected override void OnLoad(EventArgs e)
 {
     WorkroomPageBase.InitializeWorkroomPage(this);
     base.OnLoad(e);
 }
예제 #5
0
        /// <summary>
        /// Gets the invitation page link.
        /// </summary>
        /// <returns></returns>
        private string GetInvitationPageLink()
        {
            PageData userProfilePage = GetChildren(WorkroomStartPage.ParentLink).FirstOrDefault(page => String.Equals(page.PageTypeName, WorkroomPageBase.UserProfilePageTypeName));

            return(userProfilePage != null?WorkroomPageBase.CreateExternalLink(userProfilePage) : String.Empty);
        }
예제 #6
0
        /// <summary>
        /// Notifies users about changed permissions
        /// </summary>
        private void NotifyUsersByEmailAboutChangedPermissions(IList <MembershipEntry> members)
        {
            if (String.IsNullOrEmpty(EPiServerProfile.Current.Email))
            {
                NotificationErrorPanel.Text = Translate("/workroom/membershipmanager/unabletosendnotification") + " " +
                                              Translate("/workroom/membershipmanager/inviteunfiledsenderemail");
                NotificationErrorPanel.Visible = true;
                return;
            }
            NotificationSender notificationSender;

            try
            {
                notificationSender = new MembershipStatusChangeNotificationSender(EPiServerProfile.Current.Email, EPiServerProfile.Current.FirstName,
                                                                                  EPiServerProfile.Current.LastName, WorkroomPageBase.CreateExternalLink(WorkroomStartPage));
            }
            catch (FormatException ex)
            {
                NotificationErrorPanel.Text    = Translate("/workroom/membershipmanager/unabletosendnotification") + " " + ex.Message;
                NotificationErrorPanel.Visible = true;
                return;
            }

            foreach (MembershipEntry member in members)
            {
                try
                {
                    notificationSender.Send(Page as WorkroomPageBase, member);
                }
                catch (Exception ex)
                {
                    NotificationErrorPanel.Text    = Translate("/workroom/membershipmanager/unabletosendnotification") + " " + ex.Message;
                    NotificationErrorPanel.Visible = true;
                    _log.Error(String.Format("Unable to send email notification about changed membership status to workroom member {0}.", member.Name), ex);
                }
            }
        }