コード例 #1
0
        private bool SendEmailToUserAboutPasswordChange()
        {
            //string EmailAddress = UserName; commented by BM, user not yest logged in so, account info does not have e-mail.
            // We will get e-mail from User account

            // ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);
            // mailMessage.ToList.Add(EmailAddress);

            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);



            if (ConfigUtil.WebEnvironment != "prod")
            {
                mailMessage.Subject = "Changes to your account at shiptacenter.org(" + ConfigUtil.WebEnvironment + ")";
            }
            else
            {
                mailMessage.Subject = "Changes to your account at shiptacenter.org";
            }

            mailMessage.Body = CreateEmailBodyForPasswordChangeConfirmation();

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #2
0
        public bool SendResourceDenial(string emailId, string fullName)
        {
            //Send a reset email to member
            // Create the email object first, then add the properties.
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);



            //Send to the member's email address
            mailMessage.ToList.Add(emailId);

            //Subject
            if (ConfigUtil.WebEnvironment != "prod")
            {
                mailMessage.Subject = "Your shiptacenter.org upload was not approved(" + ConfigUtil.WebEnvironment + ")";
            }
            else
            {
                mailMessage.Subject = "Your shiptacenter.org upload was not approved";
            }



            mailMessage.Body = CreateResourceForDenaialEmailBody(fullName);

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #3
0
        public bool SendEmailToUserApprovedByShipAdmin(string emailId, string firstName)
        {
            //Send a reset email to member
            // Create the email object first, then add the properties.
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);



            //Send to the member's email address
            mailMessage.ToList.Add(emailId);

            //Subject
            if (ConfigUtil.WebEnvironment != "prod")
            {
                mailMessage.Subject = "Your shiptacenter.org registration(" + ConfigUtil.WebEnvironment + ")";
            }
            else
            {
                mailMessage.Subject = "Your shiptacenter.org registration";
            }

            mailMessage.Body = CreateEmailToUserApprovedByShipAdminBody(firstName);

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #4
0
ファイル: MailUtil.cs プロジェクト: nihinihi01/SHIPTACenter
        private void CreateMailMessage(ShiptalkMailMessage shipMailMessage)
        {
            //Transfer data to our Mail Message object
            shipMailMessage.ToList.ForEach(addr => MailMessageObject.To.Add(new MailAddress(addr)));
            shipMailMessage.CCList.ForEach(addr => MailMessageObject.CC.Add(new MailAddress(addr)));
            shipMailMessage.BCCList.ForEach(addr => MailMessageObject.Bcc.Add(new MailAddress(addr)));

            //Set all values required for our Mail Message object
            MailMessageObject.From       = new MailAddress(shipMailMessage.From);
            MailMessageObject.Subject    = shipMailMessage.Subject;
            MailMessageObject.Body       = shipMailMessage.Body;
            MailMessageObject.IsBodyHtml = shipMailMessage.IsBodyHtml;
        }
コード例 #5
0
        private bool SendPasswordCanNotBeChangedEmail()
        {
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);

            // mailMessage.ToList.Add(EmailAddress);
            mailMessage.Subject = "Your request at the shiptacenter.org";

            mailMessage.Body = CreateEmailBodyForPasswordCanNotBeChanged();

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #6
0
        public bool SendDisapproveEmail(string userEmail, string userName)
        {
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);


            mailMessage.ToList.Add(userEmail);
            mailMessage.Subject = "Your request was denied";

            mailMessage.Body = CreateEmailBodyForSendDisapproveEmail(userName);

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #7
0
        public bool SendApprovedEmail(string userEmail, string userName)
        {
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);



            mailMessage.ToList.Add(userEmail);
            mailMessage.Subject = "[External] Your shiptacenter.org account has been approved";

            mailMessage.Body = CreateEmailBodyForSendApproveEmail(userName);

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #8
0
        public bool SendDesignatedNotificationForResourceApproval(string state, string firstName, string lastName)
        {
            // var mailMessage = new MailMessage();

            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);


            int intStateAdmin = (int)UiEnum.ShipRolesUmbraco.shipadmin;

            int intStateDir = (int)UiEnum.ShipRolesUmbraco.shipdirector;


            var userStateAdminList = ApplicationContext.Current.Services.MemberService.GetMembersByPropertyValue("RoleAssigned", intStateAdmin, ValuePropertyMatchType.Exact).Where(x => x.IsApproved);
            var userStateDirList   = ApplicationContext.Current.Services.MemberService.GetMembersByPropertyValue("RoleAssigned", intStateDir, ValuePropertyMatchType.Exact).Where(x => x.IsApproved);
            var memberAdmin        = userStateAdminList.Where(x => x.Properties["state"].Value.ToString() == state && x.Properties["isInactive"].Value.ToString() != "1");
            var membersDir         = userStateDirList.Where(x => x.Properties["state"].Value.ToString() == state && x.Properties["isInactive"].Value.ToString() != "1");


            foreach (var member in memberAdmin)
            {
                mailMessage.ToList.Add(member.Email);
            }

            foreach (var member in membersDir)
            {
                mailMessage.ToList.Add(member.Email);
            }

            if (ConfigUtil.WebEnvironment != "prod")
            {
                mailMessage.Subject = "New resource uploaded at shiptacenter.org(" + ConfigUtil.WebEnvironment + ")";
            }
            else
            {
                mailMessage.Subject = "New resource uploaded at shiptacenter.org";
            }
            mailMessage.Body = CreateEmailBodyForResourceNotification(firstName, lastName);


            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #9
0
        public bool SendVerifyEmail(string emailId, string firstName, string verifyGUID)
        {
            //Send a reset email to member
            // Create the email object first, then add the properties.
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);



            //Send to the member's email address
            mailMessage.ToList.Add(emailId);

            //Subject
            if (ConfigUtil.WebEnvironment != "prod")
            {
                mailMessage.Subject = "Your shiptacenter.org registration(" + ConfigUtil.WebEnvironment + ")";
            }
            else
            {
                mailMessage.Subject = "Your shiptacenter.org registration";
            }

            //Verify link
            //// var verifyURL = baseURL + "/umbraco/surface/my/RenderVerifyEmail" + "?verifyGUID=" + verifyGUID;


            string linkFormat  = "<a href='" + ConfigUtil.EmailConfirmationUrl + "?e={0}&v={1}'>Follow this link</a>";
            string confirmLink = string.Format(linkFormat, emailId, verifyGUID);
            string textlink    = ConfigUtil.EmailConfirmationUrl + "?e={0}&v={1}";

            textlink = string.Format(textlink, emailId, verifyGUID);

            mailMessage.Body = CreateVerifyEmailBody(firstName, confirmLink, textlink);

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #10
0
        public bool SendPasswordResetEmail(string userEmailId, string resetGUID)
        {
            //Prepare Mail Object
            ShiptalkMailMessage mailMessage = new ShiptalkMailMessage(true, ShiptalkMailMessage.MailFrom.ShiptalkResourceCenter);

            mailMessage.ToList.Add(userEmailId);

            if (ConfigUtil.WebEnvironment != "prod")
            {
                mailMessage.Subject = "Your request at the shiptacenter.org(" + ConfigUtil.WebEnvironment + ")";
            }
            else
            {
                mailMessage.Subject = "Your request at the shiptacenter.org";
            }

            mailMessage.Body = CreateEmailBodyForResetPassword(userEmailId, resetGUID);

            //Send Mail here
            ShiptalkMail mail = new ShiptalkMail(mailMessage);

            return(mail.SendMail());
        }
コード例 #11
0
ファイル: MailUtil.cs プロジェクト: nihinihi01/SHIPTACenter
 public ShiptalkMail(ShiptalkMailMessage shipMailMessage)
 {
     CreateMailMessage(shipMailMessage);
 }