I have created a .Net Core WebAPI project with a React template. Now I want to send an email from the API with an email template. The template is in Html format so we need to read the Html file as a template from the root path but the 'wwwroot' path is not available in this project by default.
I have done this in my previous .Net Core MVC project as shown below but I don't know how to do this in the current project due to there is no 'WWWRoot' folder. Could anyone please help me that where to store this template file and how to retrieve it as a string in c#?
//Get the email template path
string templatePath = RuntimeConfig.SiteUrl + "/Template/EmailTemplate.html";
//Adding the template to the email body
using (var client = new WebClient())
{
string reader = client.DownloadString(templatePath);
StringBuilder sb = new StringBuilder();
sb.Append(reader);
....
.... --logics---
}
