コード例 #1
0
        /// <summary>
        /// Get Email Content after replacing place holder
        /// </summary>
        /// <param name="emailQueue"></param>
        /// <returns></returns>
        public static string GetEmailContent(EmailQueueVM emailQueue)
        {
            if (emailQueue == null || string.IsNullOrWhiteSpace(emailQueue.EmailContent))
            {
                return string.Empty;
            }

            var placeHolderList = emailQueue.GetType().GetProperties();

            foreach (var placeHolder in placeHolderList)
            {
                string placeHolderName = string.Format("##{0}##", placeHolder.Name).ToLower();
                string placeHolderValue = Convert.ToString(placeHolder.GetValue(emailQueue, null) ?? "&nbsp;");

                emailQueue.EmailContent = emailQueue.EmailContent.Replace(placeHolderName, placeHolderValue);
            }

            return emailQueue.EmailContent;
        }
コード例 #2
0
        /// <summary>
        /// Update email queue
        /// </summary>
        /// <param name="emailQueueVM"></param>
        /// <returns></returns>
        public int UpdateEmailQueue(EmailQueueVM emailQueueVM)
        {
            var emailNotificationServiceBLL = new EmailNotificationServiceBLL();
            Mapper.CreateMap<EmailQueueVM, EmailQueueBO>();

            var emailQueueBO = new EmailQueueBO();
            emailQueueBO = Mapper.Map<EmailQueueVM, EmailQueueBO>(emailQueueVM);
            return emailNotificationServiceBLL.UpdateEmailQueue(emailQueueBO);
        }
コード例 #3
0
ファイル: EmailUtility.cs プロジェクト: n2463230/MVC4Project
 /// <summary>
 /// Update email queue on error coming in sending email.
 /// </summary>
 public static int UpdateEmailQueue(EmailQueueVM emailQueueVM)
 {
     return ServiceReferences.FPConfigurationProviderServiceClient.UpdateEmailQueue(emailQueueVM);
 }