EmailsDone for .NET

EmailsDone.dev — Production-ready app email for developers who do not want an email project.

Add password resets, verification, notifications and billing emails without building templates, writing HTML or wiring email infrastructure.

Emails. Done.

Install


dotnet add package EmailsDone

API key

Store your EmailsDone API key in server-side configuration. Environment variables are the simplest starting point:


EMAILSDONE_API_KEY=ed_...

Do not put this key in browser JavaScript, mobile apps, public frontend configuration, source control, or client-side logs.

Send an email


using EmailsDone;

var emailsDone = EmailsDoneClient.FromApiKey(
    Environment.GetEnvironmentVariable("EMAILSDONE_API_KEY")
);

await emailsDone.Authentication().Welcome("https://app.example.com/action").Send("user@example.com");

Templates with required fields expose those fields as typed parameters:


await emailsDone
    .Authentication()
    .LoginCode(
        "123456"
    )
    .Send("user@example.com");

Optional template fields and send controls use options objects:


await emailsDone
    .Authentication()
    .LoginCode(
        new LoginCodeOptions
        {
            Code = "123456",
            FooterNote = "If you did not request this code, you can safely ignore this email.",
            FromName = "Acme App",
            IdempotencyKey = "email-user-123-v1"
        }
    )
    .Send("user@example.com");

Recipient status


var recipientStatus = await emailsDone
    .Recipient("user@example.com")
    .GetStatus();

if (recipientStatus.Recipient?.Subscription?.Status != "subscribed")
{
    await emailsDone
        .Recipient("user@example.com")
        .Resubscribe();
}

Quota


var quota = await emailsDone.GetQuota();

Idempotency

Use an idempotency key for password resets, billing emails, and other flows where your app or worker may retry the same send.


await emailsDone
    .Billing()
    .PaymentFailed(
        new PaymentFailedOptions
        {
            ActionButtonUrl = billingUrl,
            IdempotencyKey = $"payment-failed-{invoiceId}"
        }
    )
    .Send("user@example.com");

Fluent template groups

The generated client mirrors EmailsDone template categories and recipient resource actions:

  • await emailsDone.GetQuota()
  • emailsDone.Recipient(email).GetStatus()
  • emailsDone.Recipient(email).Resubscribe()
  • emailsDone.Authentication()
  • emailsDone.Billing()
  • emailsDone.Developer()
  • emailsDone.Notification()
  • emailsDone.Team()

Each method sends a named EmailsDone template through /v1/send.