MVC Mailer pass a model to the mail view

jero

New Member
I'm using the MVC Mailer - I have this in my controller:\[code\] // // POST: /ExhibitorInterest/Create [HttpPost] public ActionResult Create(ExhibitorInterest exhibitorinterest) { if (ModelState.IsValid) { db.ExhibitorInterests.Add(exhibitorinterest); db.SaveChanges(); UserMailer.ExhibitorInterest().Send(); return RedirectToAction("Thankyou"); } return View(exhibitorinterest); }\[/code\]But I want to pass the model exhibitorinterest to the mailer view:The UserMailer.cs has:\[code\]public virtual MvcMailMessage ExhibitorInterest() { //ViewBag.Data = http://stackoverflow.com/questions/12753715/someObject; return Populate(x => { x.Subject ="ExhibitorInterest"; x.ViewName = "ExhibitorInterest"; x.To.Add("[email protected]"); }); }\[/code\]Any ideas how I get exhibitorinterest into the UserMailer.cs - so I can add it to the mail view please?Thank you,Mark
 
Back
Top