I am trying to use Scriban template engine for replacing the Dictionary Values. For Example
string bodyText = "Hi,
The following service(s) has reported issues.
{{emailContent}}
Thanks " ;
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>()
{
{"emailContent", "UserManagement has following unhealthy subservice(s)"}
};
var template1 = Template.Parse(bodyText);
var result1 = template1.Render(new { emailContent = keyValuePairs[emailContent] });
Console.WriteLine(result1.ToString());
But I am getting an error at the Render line. Basically want to replace that emailContent with Dictionary. values. I know I am doing some mistakes at render line. Can anyone point out my mistake or give any solution for that. Thanks