Guest User

Untitled

a guest
Jan 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. @Html.TextBox("subject", TemplateData[0], new { @class = "form-control" })
  2.  
  3. <div class="form-group">
  4. Template: <br />
  5. @Html.DropDownList("templateName", null, htmlAttributes: new { @class = "form-control" })
  6. </div>
  7.  
  8. <div class="form-group">
  9. Subject:<br />
  10. @Html.TextBox("subject", TemplateData[0], new { @class = "form-control" })
  11. </div>
  12.  
  13. <div class="form-group">
  14. Body:<br />
  15. @Html.TextArea("body", TemplateData[1], new { @class = "form-control" })
  16. </div>
  17.  
  18. public ActionResult SendMail(int id, string templateName)
  19. {
  20. string[] templateData = new string[] { "" };
  21. if (!String.IsNullOrEmpty(templateName))
  22. {
  23. templateData = new string[] { db.Templates.Where(c => c.templateName == templateName).First().subject,
  24. db.Templates.Where(c => c.templateName == templateName).First().Body };
  25. }
  26. ViewBag.contactemail = db.Identifiers.Where(c => c.ID == id).First().contact;
  27. ViewBag.emailAddress = new SelectList(db.EmailAccounts, "emailAddress", "emailAddress");
  28. ViewBag.templateName = new SelectList(db.Templates, "templateName", "templateName");
  29. ViewBag.password = new SelectList(db.EmailAccounts, "password", "password");
  30.  
  31. return View(templateData);
  32. }
Add Comment
Please, Sign In to add comment