Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // stuff......
- return SendCreationMail(Membership.GetUser((Guid)request.UserEntityId), request, new Control());
- }
- private const string TemplateRoot = "~/app_shared/templates/mail/";
- private const string ServerRoot = TemplateRoot + "server/";
- public static bool SendCreationMail(MembershipUser user, IServerAccountRequest request, Control owner)
- {
- var definition = new MailDefinition { BodyFileName = string.Concat(ServerRoot, "creation.htm"), IsBodyHtml = true };
- var subject = "New {0} account created!".FormatWith(request.ServerApplicationContract.Id);
- var data = ExtendedData(DefaultData, subject, user);
- data.Add("<%ServerApplication%>", request.ServerApplicationContract.Id);
- data.Add("<%ServerApplicationName%>", request.ServerApplicationContract.ApplicationName);
- data.Add("<%AccountUsername%>", request.AccountUsername);
- data.Add("<%ServerInfo%>", "/server/{0}/info".FormatWith(request.ServerApplicationContract.Id.ToLower()));
- return definition.CreateMailMessage(user.Email, data, owner).Send(subject, ApplicationConfiguration.MailSenderDisplayName);
- }
- Page page = new Page();
- Test test = (Test)page.LoadControl("Test.ascx");
- return definition.CreateMailMessage(user.Email, data, test).Send(subject, ApplicationConfiguration.MailSenderDisplayName);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement