Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IssueComment"/> class.
 /// </summary>
 public IssueComment()
 {
     CreatorUser = new ITUser(new Guid(), string.Empty, string.Empty);
     CreatorUserName = string.Empty;
     Comment = string.Empty;
     CreatorDisplayName = string.Empty;
     DateCreated = DateTime.Now;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IssueComment"/> class.
 /// </summary>
 public IssueComment()
 {
     CreatorUser        = new ITUser(new Guid(), string.Empty, string.Empty);
     CreatorUserName    = string.Empty;
     Comment            = string.Empty;
     CreatorDisplayName = string.Empty;
     DateCreated        = DateTime.Now;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Issue"/> class.
 /// </summary>
 public Issue()
 {
     AssignedUser = new ITUser(new Guid(), string.Empty, string.Empty);
     AssignedDisplayName = string.Empty;
     AssignedUserName = string.Empty;
     LastUpdateUserName = string.Empty;
     Title = string.Empty;
     Description = string.Empty;
     IssueCustomFields = new List<IssueCustomField>();
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Issue"/> class.
 /// </summary>
 public Issue()
 {
     AssignedUser        = new ITUser(new Guid(), string.Empty, string.Empty);
     AssignedDisplayName = string.Empty;
     AssignedUserName    = string.Empty;
     LastUpdateUserName  = string.Empty;
     Title             = string.Empty;
     Description       = string.Empty;
     IssueCustomFields = new List <IssueCustomField>();
 }
Example #5
0
        /// <summary>
        /// Sends the user verification notification.
        /// </summary>
        /// <param name="user">The user.</param>
        public static void SendUserVerificationNotification(MembershipUser user)
        {
            if (user == null) throw new ArgumentNullException("user");

            var emailFormatType = HostSettingManager.Get(HostSettingNames.SMTPEMailFormat, EmailFormatType.Text);

            //load template and replace the tokens
            var template = NotificationManager.Instance.LoadEmailNotificationTemplate("UserVerification", emailFormatType);
            var subject = NotificationManager.Instance.LoadNotificationTemplate("UserVerification");

            var data = new Dictionary<string, object>();

            if (user.ProviderUserKey != null)
            {
                var u = new ITUser
                            {
                        Id = (Guid)user.ProviderUserKey,
                        CreationDate = user.CreationDate,
                        Email = user.Email,
                        UserName = user.UserName,
                        DisplayName = new WebProfile().GetProfile(user.UserName).DisplayName,
                        IsApproved = user.IsApproved
                    };

                data.Add("User", u);
            }
            template = NotificationManager.GenerateNotificationContent(template, data);

            var context = new NotificationContext
            {
                BodyText = template,
                EmailFormatType = emailFormatType,
                Subject = subject,
                UserDisplayName = GetUserDisplayName(user.UserName),
                Username = user.UserName
            };

            NotificationManager.Instance.SendNotification(context);
        }
Example #6
0
        /// <summary>
        /// Sends the user registered notification.
        /// </summary>
        /// <param name="userName">The user.</param>
        public static void SendUserRegisteredNotification(string userName)
        {
            if (userName == "") throw new ArgumentNullException("userName");

            var user = GetUser(userName);
            var emailFormatType = HostSettingManager.Get(HostSettingNames.SMTPEMailFormat, EmailFormatType.Text);

            //load template and replace the tokens
            var template = NotificationManager.Instance.LoadEmailNotificationTemplate("UserRegistered", emailFormatType);
            var subject = NotificationManager.Instance.LoadNotificationTemplate("UserRegisteredSubject");
            var data = new Dictionary<string, object>();

            var u = new ITUser
                {
                    CreationDate = user.CreationDate,
                    Email = user.Email,
                    UserName = user.UserName,
                    DisplayName = new WebProfile().GetProfile(user.UserName).DisplayName,
                    IsApproved = user.IsApproved
                };

            data.Add("User", u);
            template = NotificationManager.GenerateNotificationContent(template, data);

            //all admin notifications sent to admin user defined in host settings,
            var adminNotificationUsername = HostSettingManager.Get(HostSettingNames.AdminNotificationUsername);

            var context = new NotificationContext
            {
                BodyText = template,
                EmailFormatType = emailFormatType,
                Subject = subject,
                UserDisplayName = GetUserDisplayName(adminNotificationUsername),
                Username = adminNotificationUsername
            };

            NotificationManager.Instance.SendNotification(context);
        }
Example #7
0
        /// <summary>
        /// Sends the user new password notification.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="newPassword">The new password.</param>
        public static void SendUserNewPasswordNotification(MembershipUser user, string newPassword)
        {
            if (user == null) throw new ArgumentNullException("user");
            if (string.IsNullOrEmpty(newPassword)) throw new ArgumentNullException("newPassword");

            var emailFormatType = HostSettingManager.Get(HostSettingNames.SMTPEMailFormat, EmailFormatType.Text);

            //load template and replace the tokens
            var template = NotificationManager.Instance.LoadEmailNotificationTemplate("PasswordReset", emailFormatType);
            var subject = NotificationManager.Instance.LoadNotificationTemplate("PasswordResetSubject");
            var data = new Dictionary<string, object>();

            var u = new ITUser
                {
                    CreationDate = user.CreationDate,
                    Email = user.Email,
                    UserName = user.UserName,
                    DisplayName = new WebProfile().GetProfile(user.UserName).DisplayName,
                    IsApproved = user.IsApproved
                };

            data.Add("User", u);
            data.Add("Password", newPassword);
            template = NotificationManager.GenerateNotificationContent(template, data);

            var context = new NotificationContext
            {
                BodyText = template,
                EmailFormatType = emailFormatType,
                Subject = subject,
                UserDisplayName = UserManager.GetUserDisplayName(user.UserName),
                Username = user.UserName
            };

            NotificationManager.Instance.SendNotification(context);
        }