✉️Build a Full Email System in .NET with DotLiquid Templates (Already Done in EasyLaunchpad)

Adil YousafAdil Yousaf
5 min read

When you’re building a SaaS or admin-based web application, email isn’t optional — it’s essential.
Whether you’re sending account verifications, password resets, notifications, or subscription updates, a robust email system is key to a complete product experience.

But let’s be honest: setting up a professional email system in .NET can be painful and time-consuming.

That’s why EasyLaunchpad includes a pre-integrated, customizable email engine powered by DotLiquid templates*, ready for both transactional and system-generated emails. No extra configuration, no third-party code bloat — just plug it in and go.*

In this post, I’ll show you what makes the EasyLaunchpad email system unique, how DotLiquid enables flexibility, and how you can customize or scale it to match your growing app.

💡 Why Email Still Matters

Email remains one of the most direct and effective ways to communicate with users. It plays a vital role in:

  • User authentication (activation, password reset)

  • Transactional updates (payment confirmations, receipts)

  • System notifications (errors, alerts, job status)

  • Marketing communications (newsletters, upsells)

Yet, building this from scratch in .NET involves SMTP setup, formatting logic, HTML templating, queuing, retries, and admin tools. That’s at least 1–2 weeks of development time — before you even get to the fun part.

EasyLaunchpad solves all of this upfront.

⚙️ What’s Prebuilt in EasyLaunchpad’s Email Engine?

Email engine is easylaunchpad

Here’s what you get out of the box:

Feature and Description

SMTP Integration- Preconfigured SMTP setup with credentials stored securely via appsettings.json

DotLiquid Templating- Use tokenized, editable HTML templates to personalize messages

Queued Email Dispatch- Background jobs via Hangfire ensure reliability and retry logic

Admin Panel for Email Settings- Change SMTP settings and test emails without touching code

Modular Email Service- Plug-and-play email logic for any future email types

✨ What Is DotLiquid?

DotLiquid is a secure, open-source .NET templating system inspired by Shopify’s Liquid engine.

It allows you to use placeholders inside your HTML emails such as:

<p>Hello {{ user.Name }},</p>

<p>Your payment of {{ amount }} was received.</p>

This means you don’t have to concatenate strings or hardcode variables into messy inline HTML.

It’s:

  • Clean and safe (prevents code injection)

  • Readable for marketers and non-devs

  • Flexible for developers who want power without complexity

📁 Where Email Templates Live

EasyLaunchpad keeps templates organized in a Templates/Emails/ folder.

Each email type is represented as a .liquid file:

- RegistrationConfirmation.liquid

- PasswordReset.liquid

- PaymentSuccess.liquid

- CustomAlert.liquid

These are loaded dynamically, so you can update content or design without redeploying your app.

🛠 How Emails Are Sent

The process is seamless:

  1. You call the EmailService from anywhere in your codebase:

await _emailService.SendAsync(“PasswordReset”, user.Email, dataModel);

2. EasyLaunchpad loads the corresponding template from the folder.

3. DotLiquid parses and injects dynamic variables from your model.

4. Serilog logs the transaction, and the message is queued via Hangfire.

5. SMTP sends the message, with retry logic if delivery fails.

Background Jobs with Hangfire

Rather than sending emails in real-time (which can slow requests), EasyLaunchpad uses Hangfire to queue and retry delivery in the background.

This provides:

  • ✅ Better UX (non-blocking response time)

  • ✅ Resilience (automatic retries)

  • ✅ Logs (you can track when and why emails fail)

🧪 Admin Control for Testing & Updates

Inside the admin panel, you get:

  • An editable SMTP section

  • Fields for server, port, SSL, credentials

  • A test-email button for real-time delivery validation

This means your support or ops team can change mail servers or fix credentials without needing developer intervention.

🧩 Use Cases Covered Out of the Box

Email Type and the Purpose

Account Confirmation- New user activation

Password Reset- Secure link to reset passwords

Subscription Receipt- Payment confirmation with plan details

Alert Notifications- Admin alerts for system jobs or errors

Custom Templates:

✍️ How to Add Your Own Email Template

Email Templates-easylaunchpad

Let’s say you want to add a welcome email after signup.

Step 1: Create Template

Add a file: Templates/Emails/WelcomeNewUser.liquid

<h1>Welcome, {{ user.Name }}!</h1>

<p>Thanks for joining our platform.</p>

Step 2: Call the EmailService

await _emailService.SendAsync(“WelcomeNewUser”, user.Email, new { user });

Done. No controller bloat. No HTML tangled in your C# code.

📊 Logging Email Activity

Every email is tracked via Serilog:

{

“Timestamp”: “2024–07–12T14:15:02Z”,

“Level”: “Information”,

“Message”: “Password reset email sent to user@example.com”,

“Template”: “PasswordReset”

}

You can:

  • Review logs via file or dashboard

  • Filter by template name, user, or result

  • Extend logs to include custom metadata (like IP or request ID)

🔌 SMTP Setup Made Simple

In appsettings.json, configure:

“EmailSettings”: {

“Host”: “smtp.yourdomain.com”,

“Port”: 587,

“Username”: “noreply@yourdomain.com”,

“Password”: “your-secure-password”,

“EnableSsl”: true,

“FromName”: “Your App”,

“FromEmail”: “noreply@yourdomain.com”

}

And you’re good to go.

🔐 Is It Secure?

Yes. Credentials are stored securely in environment config files, never hardcoded in source. The system:

  • Sanitizes user input

  • Escapes template values

  • Avoids direct HTML injection

Plus, DotLiquid prevents logic execution (no dangerous eval() or inline C#).

🚀 Why It Matters for SaaS Builders

Here’s why the prebuilt email engine in EasyLaunchpad gives you a head start:

Benefit:

What You Save

✅ Time

1–2 weeks of setup and testing

✅ Complexity

No manual SMTP config, retry logic, or template rendering

✅ User Experience

Reliable, branded communication that builds trust

✅ Scalability

Queue emails and add templates as your app grows

✅ Control

Update templates and SMTP settings from the admin panel

🧠 Final Thoughts

Email may not be glamorous, but it’s one of the most critical parts of your SaaS app — and EasyLaunchpad treats it as a first-class citizen.

With DotLiquid templating, SMTP integration, background processing, and logging baked in, you’re ready to handle everything from user onboarding to transactional alerts from day one.

So, why should you waste time building an email system when you can use EasyLaunchpad and start shipping your actual product?

**👉 Try the prebuilt email engine inside EasyLaunchpad today at
**🔗 https://easylaunchpad.com

1
Subscribe to my newsletter

Read articles from Adil Yousaf directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Adil Yousaf
Adil Yousaf