/// <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) ?? " "); emailQueue.EmailContent = emailQueue.EmailContent.Replace(placeHolderName, placeHolderValue); } return emailQueue.EmailContent; }
/// <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); }
/// <summary> /// Update email queue on error coming in sending email. /// </summary> public static int UpdateEmailQueue(EmailQueueVM emailQueueVM) { return ServiceReferences.FPConfigurationProviderServiceClient.UpdateEmailQueue(emailQueueVM); }