Search code examples
razorrazorengine

RazorEngine templating emails


Is it possible declaring properties with razor engine like


     Hello @customername

instead of like


      Hello @Model.customername


Solution

  • As far as I know, you need the @Model to retrieve the customername. You could create a variable in the beginning of your code and populate it with the customerName, but either way you need the @Model at least once.

    var customerName = @Model.customername;
    Hello @customername