Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6572469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:00:35+00:00 2026-05-25T15:00:35+00:00

I’m seeing a lot of people using the Razor view engine for email templates.

  • 0

I’m seeing a lot of people using the Razor view engine for email templates. At first glance this seems like an excellent idea. However, after seeing the emails most people are generating I can’t help but to wonder how using Razor is any better than simply doing a string based find and replace.

Most emails fall along the lines of something like:

<html>
<head>
    <title>Welcome to mysite.com</title>
</head>
<body>
    <p>Dear @Model.Name,</p>
    <p>An account has been created for you.</p>
    <p>Your account is FREE and allows you to perform bla bla features.</p>
    <p>To login and complete your profile, please go to:</p>
    <p><a href="@Model.LogOnUrl">@Model.LogOnUrl</a></p>
    <p>Your User ID is your email address and password is: @Model.Password</p>
</body>
</html>

In this rather trivial email why not just do something like:

string result = template.Replace("@Model.Name", Model.Name);

I suppose some further web searching could answer this question, but I haven’t found a solid answer yet. Is it strictly a performance issue? Or is it just that these simple emails don’t demonstrate the real advantages of using the Razor view engine?

My question here has nothing to do with how to to implement this sort of solution, I understand how to do that. My question is just is it worth the overhead of using Razor when your emails are so basic? Especially if you’re using RazorEngine which takes string inputs and doesn’t result in any sort of compiled class for the template.

This feels like an over engineered solution to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:00:36+00:00Added an answer on May 25, 2026 at 3:00 pm

    Razor allows you to make more complicated emails later without needing to completely redesign your email system.

    For example, you can include conditionals.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I know there's a lot of other questions out there that deal with this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.