Get html from Razor template (for sending e-mail body) in ASP CoreCan I use an ASP.Net MVC Razor view to generate an nicely formatted HTML Body as the input for an email sent from the server?How do you include .html or .asp file using razor?Why not inherit from List<T>?How to get all viewmodel fields which is used in ASP.NET Razor view template?Return View as String in .NET CoreHow to get compiled C# code from cshtml view in asp.net core?Email Sender Library with Razor (.cshtml) Templates. .net core 2.0Razor Class Library in ASP .Net Core 2.1.1Retrieve HTML output from Razor page (ASP.NET Core 2.1)How to send large string from JavaScript to Asp Net Core

Is it ok to put a subplot to a story that is never meant to contribute to the development of the main plot?

Is there an explanation for Austria's Freedom Party virtually retaining its vote share despite recent scandal?

How does apt-get work, in detail?

How is character development a major role in the plot of a story

Restoring order in a deck of playing cards

Different PCB color ( is it different material? )

How feasible is the Delta-Glider?

What are these (utility?) boxes at the side of the house?

How do you deal with an abrupt change in personality for a protagonist?

Comment dit-on « I’ll tell you what » ?

Transform the partial differential equation with new independent variables

If a massive object like Jupiter flew past the Earth how close would it need to come to pull people off of the surface?

Tic-Tac-Toe for the terminal

How does an ARM MCU run faster than the external crystal?

What is the difference between nullifying your vote and not going to vote at all?

How to capture more stars?

Draw a checker pattern with a black X in the center

Can the Help action be used to give advantage to a specific ally's attack (rather than just the next ally who attacks the target)?

Is there an evolutionary advantage to having two heads?

shutdown at specific date

Split polygon using another polygon in QGIS

What is a subpixel in Super Mario Bros, and how does it relate to wall clipping?

How were these pictures of spacecraft wind tunnel testing taken?

Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?



Get html from Razor template (for sending e-mail body) in ASP Core


Can I use an ASP.Net MVC Razor view to generate an nicely formatted HTML Body as the input for an email sent from the server?How do you include .html or .asp file using razor?Why not inherit from List<T>?How to get all viewmodel fields which is used in ASP.NET Razor view template?Return View as String in .NET CoreHow to get compiled C# code from cshtml view in asp.net core?Email Sender Library with Razor (.cshtml) Templates. .net core 2.0Razor Class Library in ASP .Net Core 2.1.1Retrieve HTML output from Razor page (ASP.NET Core 2.1)How to send large string from JavaScript to Asp Net Core






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I need to convert the Razer template to html conversion in ASP.Net Core.



enter image description here



enter image description here



// TODO: Get html

string body = GetCompiledHtmlStringFromRazor
("~/Views/EmailTemplates/PasswordResetEmailTemplate.cshtml", viewModel);


Any source code for making this process simple.. ?










share|improve this question






























    0















    I need to convert the Razer template to html conversion in ASP.Net Core.



    enter image description here



    enter image description here



    // TODO: Get html

    string body = GetCompiledHtmlStringFromRazor
    ("~/Views/EmailTemplates/PasswordResetEmailTemplate.cshtml", viewModel);


    Any source code for making this process simple.. ?










    share|improve this question


























      0












      0








      0








      I need to convert the Razer template to html conversion in ASP.Net Core.



      enter image description here



      enter image description here



      // TODO: Get html

      string body = GetCompiledHtmlStringFromRazor
      ("~/Views/EmailTemplates/PasswordResetEmailTemplate.cshtml", viewModel);


      Any source code for making this process simple.. ?










      share|improve this question
















      I need to convert the Razer template to html conversion in ASP.Net Core.



      enter image description here



      enter image description here



      // TODO: Get html

      string body = GetCompiledHtmlStringFromRazor
      ("~/Views/EmailTemplates/PasswordResetEmailTemplate.cshtml", viewModel);


      Any source code for making this process simple.. ?







      c# asp.net-core razor






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 13:16







      Mark Macneil Bikeio

















      asked Mar 24 at 8:45









      Mark Macneil BikeioMark Macneil Bikeio

      1,0941427




      1,0941427






















          1 Answer
          1






          active

          oldest

          votes


















          0














          For .Net use RazorEngine



          https://github.com/Antaris/RazorEngine



          Use .NetCore use RazorEngine.NetCore



          https://github.com/fouadmess/RazorEngine



          enter image description here






          share|improve this answer























          • This worked for me 👍

            – Mark Macneil Bikeio
            Mar 24 at 13:50











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322039%2fget-html-from-razor-template-for-sending-e-mail-body-in-asp-core%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          For .Net use RazorEngine



          https://github.com/Antaris/RazorEngine



          Use .NetCore use RazorEngine.NetCore



          https://github.com/fouadmess/RazorEngine



          enter image description here






          share|improve this answer























          • This worked for me 👍

            – Mark Macneil Bikeio
            Mar 24 at 13:50















          0














          For .Net use RazorEngine



          https://github.com/Antaris/RazorEngine



          Use .NetCore use RazorEngine.NetCore



          https://github.com/fouadmess/RazorEngine



          enter image description here






          share|improve this answer























          • This worked for me 👍

            – Mark Macneil Bikeio
            Mar 24 at 13:50













          0












          0








          0







          For .Net use RazorEngine



          https://github.com/Antaris/RazorEngine



          Use .NetCore use RazorEngine.NetCore



          https://github.com/fouadmess/RazorEngine



          enter image description here






          share|improve this answer













          For .Net use RazorEngine



          https://github.com/Antaris/RazorEngine



          Use .NetCore use RazorEngine.NetCore



          https://github.com/fouadmess/RazorEngine



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 24 at 13:47









          Mark Macneil BikeioMark Macneil Bikeio

          1,0941427




          1,0941427












          • This worked for me 👍

            – Mark Macneil Bikeio
            Mar 24 at 13:50

















          • This worked for me 👍

            – Mark Macneil Bikeio
            Mar 24 at 13:50
















          This worked for me 👍

          – Mark Macneil Bikeio
          Mar 24 at 13:50





          This worked for me 👍

          – Mark Macneil Bikeio
          Mar 24 at 13:50



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322039%2fget-html-from-razor-template-for-sending-e-mail-body-in-asp-core%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript