SHARE
TWEET

Untitled

a guest Jun 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // stuff......
  2.  
  3.     return SendCreationMail(Membership.GetUser((Guid)request.UserEntityId), request, new Control());
  4. }
  5.  
  6. private const string TemplateRoot = "~/app_shared/templates/mail/";
  7. private const string ServerRoot = TemplateRoot + "server/";
  8.  
  9. public static bool SendCreationMail(MembershipUser user, IServerAccountRequest request, Control owner)
  10. {
  11.     var definition = new MailDefinition { BodyFileName = string.Concat(ServerRoot, "creation.htm"), IsBodyHtml = true };
  12.     var subject = "New {0} account created!".FormatWith(request.ServerApplicationContract.Id);
  13.  
  14.     var data = ExtendedData(DefaultData, subject, user);
  15.  
  16.     data.Add("<%ServerApplication%>", request.ServerApplicationContract.Id);
  17.     data.Add("<%ServerApplicationName%>", request.ServerApplicationContract.ApplicationName);
  18.     data.Add("<%AccountUsername%>", request.AccountUsername);
  19.  
  20.     data.Add("<%ServerInfo%>", "/server/{0}/info".FormatWith(request.ServerApplicationContract.Id.ToLower()));
  21.  
  22.     return definition.CreateMailMessage(user.Email, data, owner).Send(subject, ApplicationConfiguration.MailSenderDisplayName);
  23. }
  24.      
  25. Page page = new Page();
  26.  
  27. Test test = (Test)page.LoadControl("Test.ascx");
  28.      
  29. return definition.CreateMailMessage(user.Email, data, test).Send(subject, ApplicationConfiguration.MailSenderDisplayName);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top