mjml-email-templates

Create responsive cross-client email templates using MJML with .NET Razor-style variable substitution.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill mjml-email-templates-agibuild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mjml-email-templates
Source: https://github.com/AGIBuild/dotnet.CI.template/tree/main/.cursor/skills/mjml-email-templates
Command: npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill mjml-email-templates-agibuild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Mjml.Net.

What problem does it solve? Email HTML renders inconsistently across clients like Outlook, Gmail, and Apple Mail, forcing developers to write fragile table-based layouts with inline styles by hand. This Skill provides a complete pattern for building responsive emails with MJML compiled through Mjml.Net in .NET applications. ## Core Features & Use Cases - MJML Template Structure: Shared layout templates with header, footer, and content injection, plus per-email content templates using {{Variable}} placeholders. - Template Renderer: A C# IMjmlTemplateRenderer that loads embedded .mjml resources, substitutes variables via regex, and compiles to cross-client HTML with Mjml.Net. - Composer Pattern: Strongly-typed email composers using value objects (EmailAddress, PersonName, AbsoluteUri) to separate rendering from message composition. - Use Case: Build a user invitation email by defining UserSignupInvitation.mjml, embedding it as a resource, and calling ComposeSignupInvitationAsync to produce a responsive HTML email with an admin preview endpoint for development. ## Quick Start Ask the AI to create an MJML email template with a shared layout and a .NET renderer using Mjml.Net for a password reset email.

Frequently Asked Questions about mjml-email-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create responsive email templates in .NET?▼

Use MJML markup compiled with the Mjml.Net NuGet package. Write templates with components like mj-section, mj-column, mj-text, and mj-button, then render them through MjmlRenderer to produce table-based HTML that works across email clients.

What is MJML and why use it for emails?▼

MJML is a markup language that compiles to responsive, cross-client email HTML. It replaces hand-written table layouts and inline styles, generating roughly 200 lines of compatible HTML from a few readable tags.

How do I pass variables into MJML templates in C#?▼

Use {{VariableName}} placeholders in the .mjml file and substitute them with a compiled regex before rendering. A dictionary of variable names to values is merged with layout-level variables like SiteUrl, then replaced in the combined MJML string.

Can I preview MJML emails during development?▼

Yes, map an admin endpoint such as /admin/emails/preview/{template} that renders the template with sample variables and returns the result as text/html. Protect it with an authorization policy like AdminOnly.

Why do MJML email images not display in some clients?▼

Images fail when using relative paths, since email clients cannot resolve them. Always use absolute production URLs like https://myapp.com/logo.png in mj-image elements so every client can load the asset.