Skip to content

GorillaGeek/gorilla.mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gorilla Geek Mailer

Install from nuget: https://www.nuget.org/packages/Gorilla.Mailer/

Install-Package Gorilla.Mailer

How to use

// Development
var mailer = Provider.DevelopmentMailer("path-to-folder-output");
var providerResultKey = await mailer.Send("Subject", "From", "To", "Body");

Template

From String:

var template = MailerTemplate.CreateFromString("Your template here [TemplateVariable]");
template.Params.Add("TemplateVariable", "with variables");

var body = template.Render();

From File:

var template = MailerTemplate.CreateFromFileSystem("path-to-file");

From Namespace:

// Remember to change the file property 'Buld Action' to 'Embedded Resource'
var path = "MyApp.Templates.Email.html";
var template = MailerTemplate.CreateFromManifestResourceStream(path);