.Net Core Email Sender Library with Razor Templates (.cshtml) contained in it

Some time ago we needed to include email sender in our application. There were plenty of email services that we can choose from (MailGun, SendGrid, Mandrill, etc…). We choosed SendGrid since it has 40,000 emails for your first 30 days, then 100 email/day forever

Gavril Ognjanovski
4 min readNov 7, 2018
“six assorted-color mail boxes” by Mathyas Kurmann on Unsplash

Our application consists of multiple separate .net core web applications. We use the SendGrid nuget package for sending emails. So we wanted to manage all the emails from one place for all of the applications. That’s why we made a separate class library as our email client service which also contains all the Razor templates that are required for our application.

Working version of this class library is available on GitHub https://github.com/gognjanovski/EmailClientLibrary/tree/EmailClientRazorLight

From here I will start explaining the technical implementation of the web class library and how you can easily use it if you need it. On GitHub there are two projects TestWebApp which is the .net core web application and EmailClient which is the .net class library.

The Client Web Application

--

--

Gavril Ognjanovski

Driven by a relentless curiosity and dedication to simplifying lives through technology