ModularPipelines.Email 3.2.8

Prefix Reserved
dotnet add package ModularPipelines.Email --version 3.2.8
                    
NuGet\Install-Package ModularPipelines.Email -Version 3.2.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ModularPipelines.Email" Version="3.2.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ModularPipelines.Email" Version="3.2.8" />
                    
Directory.Packages.props
<PackageReference Include="ModularPipelines.Email" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ModularPipelines.Email --version 3.2.8
                    
#r "nuget: ModularPipelines.Email, 3.2.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ModularPipelines.Email@3.2.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ModularPipelines.Email&version=3.2.8
                    
Install as a Cake Addin
#tool nuget:?package=ModularPipelines.Email&version=3.2.8
                    
Install as a Cake Tool

ModularPipelines

Write CI/CD pipelines in C#. Debug them locally. Ship with confidence.

nuget

Nuget GitHub Workflow Status (with event) GitHub last commit (branch) Codacy Badge CodeFactor License Codacy Badge codecov

The Problem with YAML Pipelines

You know the drill. You write some YAML, push it, wait for CI to start, watch it fail on a typo, fix it, push again, wait again. Repeat until you lose the will to live.

YAML pipelines are:

  • Impossible to debug locally - "Works on my machine" but fails mysteriously in CI
  • No compile-time safety - Typos in variable names? Enjoy your 10-minute feedback loop
  • Copy-paste hell - Reusing logic means duplicating YAML and hoping you update all the copies
  • Vendor lock-in - Switching from GitHub Actions to Azure Pipelines? Rewrite everything

The Solution

ModularPipelines lets you write your CI/CD pipelines as regular C# code. That means:

Set a breakpoint. Step through your pipeline. Fix it before you push.

[DependsOn<BuildModule>]
[DependsOn<TestModule>]
public class PublishModule : Module<CommandResult>
{
    protected override async Task<CommandResult?> ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken)
    {
        // This is real C#. Set a breakpoint. Inspect variables. Debug locally.
        return await context.DotNet().Publish(new DotNetPublishOptions
        {
            Project = "src/MyApp/MyApp.csproj",
            Configuration = Configuration.Release,
            Output = "publish/"
        }, cancellationToken);
    }
}

Why Developers Choose ModularPipelines

Your IDE Actually Helps You

Intellisense, refactoring, compile-time errors. Your pipeline code gets the same treatment as your application code. Rename a module? Your IDE updates all the references. Typo in an option? Red squiggle before you even save.

Run Locally, Push Confidently

Test your entire pipeline on your machine before pushing. No more "let me push and see if it works" commits. Debug failures in your IDE instead of reading logs from a build agent.

Automatic Parallelization

Modules declare their dependencies with attributes. ModularPipelines figures out what can run in parallel and maximizes throughput. No more manually orchestrating parallel jobs.

Switch Build Systems Without Rewriting

Your pipeline logic lives in C#, not in vendor-specific YAML. Moving from GitHub Actions to Azure Pipelines to TeamCity? Change one line - your modules stay the same.

Full Dependency Injection

Inject services, configuration, and secrets the same way you do in ASP.NET Core. Mock dependencies for testing. No more environment variable gymnastics.

Secrets Stay Secret

Secrets are automatically obfuscated in logs. No more accidentally exposing API keys in build output.

Modules Share Data

Modules return strongly-typed results that other modules can consume. No shared mutable state - just clean data flow.

// BuildModule returns version info
public class BuildModule : Module<BuildInfo>
{
    protected override async Task<BuildInfo?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
    {
        await context.DotNet().Build(new DotNetBuildOptions { Project = "MyApp.csproj" }, cancellationToken);
        return new BuildInfo { Version = "1.0.0", OutputPath = "bin/Release" };
    }
}

// PublishModule retrieves and uses it
[DependsOn<BuildModule>]
public class PublishModule : Module
{
    protected override async Task ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
    {
        var buildResult = await GetModule<BuildModule>();
        var outputPath = buildResult.Value!.OutputPath; // Strongly-typed, compile-time checked
        // Publish using the build output...
    }
}

Catch Mistakes at Compile Time

Built-in Roslyn analyzers catch common mistakes before you even run:

  • Missing [DependsOn] when calling GetModule<T>()
  • Circular dependencies between modules
  • Forgetting to await module results
  • Using Console.Write instead of the logging system

Full Documentation

Quick Start

dotnet new console -n MyPipeline
cd MyPipeline
dotnet add package ModularPipelines
// Program.cs
await PipelineHostBuilder.Create()
    .AddModule<BuildModule>()
    .AddModule<TestModule>()
    .AddModule<PublishModule>()
    .ExecutePipelineAsync();
// BuildModule.cs
public class BuildModule : Module<CommandResult>
{
    protected override async Task<CommandResult?> ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken)
    {
        return await context.DotNet().Build(new DotNetBuildOptions
        {
            Project = "MySolution.sln",
            Configuration = Configuration.Release
        }, cancellationToken);
    }
}
// TestModule.cs
[DependsOn<BuildModule>]
public class TestModule : Module<CommandResult>
{
    protected override async Task<CommandResult?> ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken)
    {
        return await context.DotNet().Test(new DotNetTestOptions
        {
            Project = "MySolution.sln",
            Configuration = Configuration.Release
        }, cancellationToken);
    }
}

Run it:

dotnet run

That's it. No YAML. No waiting for CI. Just dotnet run and watch your pipeline execute.

Console Progress

See exactly what's happening as your pipeline runs:

image

Results

Get a clear summary when your pipeline completes:

<img width="444" alt="image" src="https://github.com/thomhurst/ModularPipelines/assets/30480171/8963e891-2c29-4382-9a3e-6ced4daf4d4b">

Integrations

ModularPipelines has strongly-typed wrappers for the tools you already use:

Package Description Version
ModularPipelines Write your pipelines in C#! nuget
ModularPipelines.AmazonWebServices Helpers for interacting with Amazon Web Services. nuget
ModularPipelines.Azure Helpers for interacting with Azure. nuget
ModularPipelines.Azure.Pipelines Helpers for interacting with Azure Pipeline agents. nuget
ModularPipelines.Chocolatey Helpers for interacting with the Chocolatey CLI. nuget
ModularPipelines.Cmd Helpers for interacting with the Windows cmd process. nuget
ModularPipelines.Docker Helpers for interacting with the Docker CLI. nuget
ModularPipelines.DotNet Helpers for interacting with dotnet CLI. nuget
ModularPipelines.Email Helpers for sending emails. nuget
ModularPipelines.Ftp Helpers for downloading and uploading via FTP. nuget
ModularPipelines.Yarn Helpers for interacting with Yarn CLI. nuget
ModularPipelines.Node Helpers for interacting with node / npm CLI. nuget
ModularPipelines.Git Helpers for interacting with git. nuget
ModularPipelines.GitHub Helpers for interacting with GitHub Actions build agents. nuget
ModularPipelines.Google Helpers for interacting with the Google gcloud CLI. nuget
ModularPipelines.Helm Helpers for interacting with Helm CLI. nuget
ModularPipelines.Kubernetes Helpers for interacting with kubectl CLI. nuget
ModularPipelines.MicrosoftTeams Helpers for sending Microsoft Teams cards.