Skip to content

Latest commit

 

History

History
72 lines (61 loc) · 1.84 KB

README.md

File metadata and controls

72 lines (61 loc) · 1.84 KB

Kuvert

Build Status Latest Version Coverage Status

Kuvert is a library that generates clean, responsive HTML & plain-text for sending transactional emails.

Samples

TODO: images

Installation

dotnet add package Kuvert

Dependency Injection

You can configure Kuvert in Startup.cs. Now IKuvert will be correctly injected.

services.AddKuvert(options =>
{
    options.Product = new Product("my product", "https://example.com"));
}).AddDefaultTemplate();

Usage

TODO: usage

var (html, text) = await kuvert.Generate(
    new Email()
    {
        PreHeader = "Pre header text...",
        Header = new Header()
        {
            Greeting = "Hey",
            Name = "Test User",
        },
        Intros = new List<string>()
        {
            "Test Intro 1",
            "Test Intro 2"
        },
        Dictionary = new List<(string, string)>()
        {
            ("key", "value"),
            ("key2", "value2"),
        },
        Actions = new List<EmailAction>()
        {
            new EmailAction()
            {
                Instructions = "Test Instruction",
                Button = new EmailButton()
                {
                    Text = "Test Button",
                    Link = "https://example.com/testbutton"
                }
            }
        },
        Outros = new List<string>()
        {
            "Test Outro 1",
            "Test Outro 2"
        },
    }
);