The data is posted from angular:

    public IHttpActionResult Order([FromBody]Order order)
        var template = File.ReadAllText(HostingEnvironment.MapPath("~/EmailTemplate/OrderSentEmail.cshtml"));

        var body = Engine.Razor.RunCompile(template, "templateKey", null, order);
        mail.Body = body;

When I try sending the email I get the error: 'Project.Models.Order' does not contain a definition for 'Order'

I have an email template view setup using the Model and Razor.

The model class is an object that contains another object, plus several lists of objects of varying length.

Please be gentle if this questions appears frivolous.

Related posts

Recent Viewed