Exemple #1
0
        /// <summary>
        /// Method Name: SendSignUpConfirmationMail.
        /// Method Purpose: This method used to send signup confirmation mail.
        /// Author: Mena Armanyous.
        /// Modification Date: May 08, 2011.
        /// </summary>
        /// <param name="pContact"></param>
        /// <param name="pIsSecureConnection"></param>
        public bool SendSignUpConfirmationMail(Contact pContact, bool pIsSecureConnection)
        {
            try
            {
                //forming the notification mail then sent
                PrimitiveContact lSerContact = new PrimitiveContact(pContact);

                string strhttp = "http";
                if (pIsSecureConnection == true)
                {
                    strhttp += "s";
                }

                string lContactUsPath = "some url";
                string lMyAccountPath = "some url";

                SNDCommonMailParameters lSNDCommonMailParameters = new SNDCommonMailParameters();
                string strSNDURL = System.Configuration.ConfigurationManager.AppSettings["SNDSiteUrl"];
                lSNDCommonMailParameters.MyAccountLink = string.Format("{0}://{1}{2}{3}", strhttp, strSNDURL, HttpContext.Current.Request.ApplicationPath, lMyAccountPath);
                lSNDCommonMailParameters.ContactUsLink = string.Format("{0}://{1}{2}{3}", strhttp, strSNDURL, HttpContext.Current.Request.ApplicationPath, lContactUsPath);
                lSNDCommonMailParameters.Username      = (pContact.Account.aspnet_Users.UserName);

                string lFAQPath = "some url";
                lSNDCommonMailParameters.FAQLink = string.Format("{0}://{1}{2}{3}", strhttp, strSNDURL, HttpContext.Current.Request.ApplicationPath, lFAQPath);

                NotificationManager notificationManager =
                    new NotificationManager(enumNotificationType.Online_account_creation, enumNotificationCategory.Account_Service, lSerContact, lSNDCommonMailParameters);
                return(notificationManager.SendNotification((pContact.Email)));
            }
            catch (Exception ex)
            {
                if (!ExceptionHandler.IsUserFriendly(ex))
                {
                    ex.Data.Add("ClassName", "NavBase");
                    ex.Data.Add("MethodName", "SendSignUpConfirmationMail");
                    ExceptionHandler.handle(ex);
                    return(false);
                }
                else
                {
                    throw ex;
                }
            }
        }
        /// <summary>
        /// Method Name: SendSignUpConfirmationMail.
        /// Method Purpose: This method used to send signup confirmation mail.
        /// Author: Mena Armanyous.
        /// Modification Date: May 08, 2011.
        /// </summary>
        /// <param name="pContact"></param>
        /// <param name="pIsSecureConnection"></param>
        public bool SendSignUpConfirmationMail(Contact pContact, bool pIsSecureConnection)
        {
            try
            {
                //forming the notification mail then sent
                PrimitiveContact lSerContact = new PrimitiveContact(pContact);

                string strhttp = "http";
                if (pIsSecureConnection == true)
                { strhttp += "s"; }

                string lContactUsPath = "some url";
                string lMyAccountPath = "some url";

                SNDCommonMailParameters lSNDCommonMailParameters = new SNDCommonMailParameters();
                string strSNDURL = System.Configuration.ConfigurationManager.AppSettings["SNDSiteUrl"];
                lSNDCommonMailParameters.MyAccountLink = string.Format("{0}://{1}{2}{3}", strhttp, strSNDURL, HttpContext.Current.Request.ApplicationPath, lMyAccountPath);
                lSNDCommonMailParameters.ContactUsLink = string.Format("{0}://{1}{2}{3}", strhttp, strSNDURL, HttpContext.Current.Request.ApplicationPath, lContactUsPath);
                lSNDCommonMailParameters.Username = (pContact.Account.aspnet_Users.UserName);

                string lFAQPath = "some url";
                lSNDCommonMailParameters.FAQLink = string.Format("{0}://{1}{2}{3}", strhttp, strSNDURL, HttpContext.Current.Request.ApplicationPath, lFAQPath);

                NotificationManager notificationManager =
               new NotificationManager(enumNotificationType.Online_account_creation, enumNotificationCategory.Account_Service, lSerContact, lSNDCommonMailParameters);
                return notificationManager.SendNotification((pContact.Email));
            }
            catch (Exception ex)
            {
                if (!ExceptionHandler.IsUserFriendly(ex))
                {
                    ex.Data.Add("ClassName", "NavBase");
                    ex.Data.Add("MethodName", "SendSignUpConfirmationMail");
                    ExceptionHandler.handle(ex);
                    return false;
                }
                else
                { throw ex; }
            }
        }