Get Started
Setup
Start building awesome emails in under 5 minutes.
1. Install
Navigate to the project directory you want to create the templates in, and run
nuget
2. Dependency Injection
To register the renderer, add the following line in your Program.cs or Startup.cs:
Using AddTransient creates a new instance of the BlazorEmailRenderer
each time it is requested, making it ideal for lightweight and stateless services.
3. Create your first email template
To create an email template, create a new file with the .razor
type, eg. EmailTemplate.razor
.
Then do:
EmailTemplate.razor
4. Render template to HTML and send the email
In this example, the ExampleClass
demonstrates how to render an email template to HTML and send it using the BlazorEmailRenderer and some email client.
It’s as simple as that