forked from smsohan/MvcMailer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate should return MvcMailMessage. Cleanup T4 templates.
- Loading branch information
1 parent
f02c4fd
commit e4b1bcb
Showing
5 changed files
with
9 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> | ||
<#@ Output Extension="cs" #> | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using Mvc.Mailer; | ||
using System.Net.Mail; | ||
|
||
namespace <#= Model.Namespace #>.Mailers | ||
{ | ||
public class <#= Model.MailerName #> : MailerBase<# if( Model.Interface) { #>, I<#= Model.MailerName #> <# } #> | ||
|
||
{ | ||
public <#= Model.MailerName #>(): | ||
base() | ||
public <#= Model.MailerName #>() | ||
{ | ||
MasterName="_Layout"; | ||
} | ||
|
||
<# foreach(var mailerMethod in Model.MailerMethods) {#> | ||
|
||
public virtual MailMessage <#= mailerMethod #>() | ||
{ | ||
var mailMessage = new MailMessage{Subject = "<#= mailerMethod #>"}; | ||
|
||
//mailMessage.To.Add("some-email@example.com"); | ||
//ViewBag.Data = someObject; | ||
PopulateBody(mailMessage, viewName: "<#= mailerMethod #>"); | ||
|
||
return mailMessage; | ||
return Populate(x => | ||
{ | ||
x.Subject = "<#= mailerMethod #>"; | ||
x.ViewName = "<#= mailerMethod #>"; | ||
x.To.Add("some-email@example.com"); | ||
}); | ||
} | ||
|
||
<# } #> | ||
|
||
} | ||
} |
Binary file not shown.