Generating HTML emails with RazorEngine - Part 02 - Basics: generating your first email

This is the second part of a 10-part blog series. You'll find a list of all the posts in this series in the introductory post. Make sure to review the Before we start section in the introductory post. All the source code is on GitHub. Comment? Bug? Open an issue on GitHub. As indicated in the introductory post, we'll work from a console application. The email template For this example, we'll generate a simple Welcome email. We'll start with a basic model for our email: namespace ConsoleApplication.Models { public class UserModel { public string Name { get; set; } public string Email { get; set; } public bool IsPremiumUser { get; set; } } } We can then implement our email template in the same way as we would implement an ASP.NET MVC Razor view. Here, we'll use a strongly-typed model: @model ConsoleApplication.Models.UserModel <!DOCTYPE html> <html lang="en" xmlns="http: … [+]
Read more

Generating HTML emails with RazorEngine - Part 01 - Introduction

Blog posts in this series: Introduction (this post) Basics: generating your first email More Basics: caching, VS integration & namespace configuration Taking a step back: what is Razor and what does RazorEngine actually do? URL generation & T4MVC integration with RazorEngine (TBD) Layout with RazorEngine (TBD) Partials with RazorEngine (TBD) On keeping your sanity: inlining CSS with PreMailer.Net (TBD) Getting a little help from CsQuery: including subject, sender and recipient information in your email templates (TBD) Putting it all together: building a complete email-generation library with RazorEngine, PreMailer.Net and CsQuery (TBD) I can think of few things in my life as a software developer that have caused me more grief than having to generate HTML emails. I long for the days when you could still argue in favour of plain text emails with clients. HTML emails are a strange kind of beast. On one side, they're part of … [+]
Read more - the first blogging platform that makes me happy

Blogs have established themselves as one of the main building blocks of the web. Even though it's been a long time since having a blog was the latest fad among self-respecting hipsters, blogs are still just about everywhere. In fact, virtually everything you read on the web today is published as a blog post. So it boggles my mind that 16 years after the word Blog was coined, the most popular blogging platforms out there are still so goddamn awful - slow, bloated and clunky with dreadful text editors. So it has been a bit of a revelation when I discovered Ghost earlier this week through their annoucement of version 0.4. It's rare for me to instantly fall in love with a piece of software, especially an early beta one. But Ghost is one of those rare occasions. It's that good. And, yes, this blog is hosted on Ghost. … [+]
Read more

Setting up a Windows Server 2012 R2 virtual machine with Xen on Ubuntu

Content Why? Creating your virtual machine Where are the Xen configuration files? Where are the Xen log files? Troubleshooting common problems Was it worth it? Windows performance on Xen Why? At Tickmeet, our build, test and deployment system for our web apps and back-end services are a one-click affair thanks to the awesome TeamCity. Up until now, our TeamCity server lived on a Rackspace Cloud Server. Not because it makes sense to have a CI server in the cloud (hint: it doesn’t). But simply because we happened to have that server lying around when we decided to give TeamCity a try. And as its happens, our playground server ended up becoming our main (and only) CI server. Lately however, that setup started showing its limits. Raw performance of cloud servers aren’t great and prices are astronomical for what you get. CI is a terrible use-case scenario for a … [+]
Read more