/// <summary> /// Get mail content in HTML format. /// </summary> /// <param name="pageRef">Pagelink to mailpage</param> /// <returns>HTML</returns> public virtual string GetPageHtml(PageReference pageRef) { if (_log.IsDebugEnabled()) { _log.Debug("Beginning to generate Page Html for {0}.", pageRef.ToString()); } PageData pageData = GetPage(pageRef); return(GetPageHtml(pageData)); }
protected PageData GetPage(PageReference pageRef) { IContentRepository contentRepository = ServiceLocator.Current.GetInstance <IContentRepository>(); ContentReference contentLink = pageRef.ToReferenceWithoutVersion(); PageData pageData = contentRepository.Get <PageData>(contentLink); if (pageData == null) { throw new NullReferenceException("Cannot Load Page: " + pageRef.ToString()); } return(pageData); }
protected PageData GetPageWithChecks(PageReference pagelink) { if (pagelink == PageReference.EmptyReference) { throw new ArgumentException("PageReference to mailpage is empty, no content to send.", "pagelink"); } // Load page PageData mailPage = null; if (ContentRepository.Service.TryGet <PageData>(pagelink, out mailPage) == false) { throw new NullReferenceException("Cannot load newsletter page (" + pagelink.ToString() + ")"); } return(mailPage); }
protected PageData GetPageWithChecks(PageReference pagelink) { if (pagelink == PageReference.EmptyReference) throw new ArgumentException("PageReference to mailpage is empty, no content to send.", "pagelink"); // Load page PageData mailPage = null; if (ContentRepository.Service.TryGet<PageData>(pagelink, out mailPage) == false) throw new NullReferenceException("Cannot load newsletter page (" + pagelink.ToString() + ")"); return mailPage; }
protected PageData GetPage(PageReference pageRef) { IContentRepository contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>(); ContentReference contentLink = pageRef.ToReferenceWithoutVersion(); PageData pageData = contentRepository.Get<PageData>(contentLink); if (pageData == null) { throw new NullReferenceException("Cannot Load Page: " + pageRef.ToString()); } return pageData; }
/// <summary> /// Get mail content in HTML format. /// </summary> /// <param name="pageRef">Pagelink to mailpage</param> /// <returns>HTML</returns> public virtual string GetPageHtml(PageReference pageRef) { if (_log.IsDebugEnabled()) _log.Debug("Beginning to generate Page Html for {0}.", pageRef.ToString()); PageData pageData = GetPage(pageRef); return GetPageHtml(pageData); }