public SendEmailOptions GetSendMailOptions(int userid, TemplateContext templateContext) { var mailOptions = new SendEmailOptions() { ToUserId = userid, Header = _templateController.RenderTokenString(EmailTarget.Header.ToTemplateTypeString(), templateContext), Footer = _templateController.RenderTokenString(EmailTarget.Footer.ToTemplateTypeString(), templateContext), Subject = _templateController.RenderTokenString(EmailTarget.Subject.ToTemplateTypeString(), templateContext), Body = _templateController.RenderTokenString(EmailTarget.Body.ToTemplateTypeString(), templateContext), }; return(mailOptions); }
private string RenderTemplate(string templateName, Notification notification) { var content = TEApi.Content.Get(notification.ContentId.GetValueOrDefault(), notification.ContentTypeId.GetValueOrDefault()); if (content == null) { return(null); } var tokenContext = new TemplateContext(); tokenContext.AddItem(Telligent.Evolution.Api.Content.ContentTypes.GenericContent, notification.Content); //tokenContext.AddItem(PublicApi.Comments.ContentTypeId, comment); return(_templatablePluginController.RenderTokenString(templateName, tokenContext)); }