Example #1
0
        /// <summary>
        /// Applys templating to the body
        /// </summary>
        /// <param name="templateName">Name of the template</param>
        /// <param name="values">Values to be used in template body</param>
        /// <returns>Body after values applied to the template</returns>
        public string GetBody(string templateName, Dictionary <string, object> values)
        {
            HTMLTemplate template = _settingManager.GetContainer <HTMLTemplate>()[templateName];
            string       body     = File.ReadAllText(this._appManager.MapPhysicalFile(template.BodyFilePath));

            return(Engine.Razor.RunCompile(body, template.Name + "_Body", null, new DynamicViewBag(values)));
        }
Example #2
0
        /// <summary>
        /// Applys templating to the subject
        /// </summary>
        /// <param name="templateName">Name of the template</param>
        /// <param name="values">Values to be used in template subject</param>
        /// <returns>Subject after values applied to the template</returns>
        public string GetSubject(string templateName, Dictionary <string, object> values)
        {
            HTMLTemplate template = _settingManager.GetContainer <HTMLTemplate>()[templateName];

            return(Engine.Razor.RunCompile(template.Subject, template.Name + "_Subject", null, values));
        }