public static void SendLeadAlert(Accounts.UserAccount u, Accounts.Store s) { Accounts.Store tempStore = new Accounts.Store(); MailServices sender = new MailServices(tempStore); if (u == null || s == null) { return; } MailMessage m = new MailMessage(WebAppSettings.ApplicationEmail, WebAppSettings.SuperAdminEmail); if (s.PlanId == 0) { m.Subject = "BV Hosted FREE Signup Lead | Contact Form"; } else { m.Subject = "BV Hosted PAID PLAN signup | Contact Form"; } if (s.Settings.LeadSource == "PayPalOffer") { m.Subject += " | from PayPal Offer"; } StringBuilder sb = new StringBuilder(); sb.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); sb.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\" >"); sb.Append("<head><title>New Hosted Signup Lead</title>"); sb.Append(RenderEmailHtmlStyles()); sb.Append("</head><body><div style=\"padding:20px;\">"); sb.Append("<h1>New Hosted Store Signup</h1>"); sb.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">"); sb.Append(RenderEmailTableRow("Email", u.Email)); sb.Append(RenderEmailTableRow("Store Name", s.StoreName)); sb.Append(RenderEmailTableRowLink("Store URL", s.RootUrl(), s.RootUrl())); sb.Append(RenderEmailTableRowLink("Store Admin URL", s.RootUrl() + "admin", s.RootUrl() + "admin")); sb.Append("</table>"); sb.Append(" <br />"); sb.Append(" <br />"); sb.Append("</div></body></html>"); m.IsBodyHtml = true; m.Body = sb.ToString(); sender.SendMail(m); }
public static void SendPlanDowngradeAlert(Accounts.UserAccount u, Accounts.Store s) { if (u == null || s == null) { return; } MailMessage m = new MailMessage(WebAppSettings.ApplicationEmail, WebAppSettings.SuperAdminEmail); m.Subject = "BV Hosted | Plan Downgrade to " + s.PlanName; if (s.Settings.LeadSource == "PayPalOffer") { m.Subject += " | from PayPal Offer"; } StringBuilder sb = new StringBuilder(); sb.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); sb.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\" >"); sb.Append("<head><title>New Hosted Plan Downgrade</title>"); sb.Append(RenderEmailHtmlStyles()); sb.Append("</head><body><div style=\"padding:20px;\">"); sb.Append("<h1>New Hosted Plan Downgrade</h1>"); sb.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">"); sb.Append(RenderEmailTableRow("Email", u.Email)); sb.Append(RenderEmailTableRow("Store Name", s.StoreName)); sb.Append(RenderEmailTableRowLink("Store URL", s.RootUrl(), s.RootUrl())); sb.Append(RenderEmailTableRowLink("Store Admin URL", s.RootUrl() + "admin", s.RootUrl() + "admin")); sb.Append(RenderEmailTableRow("Downgraded to Plan", s.PlanName)); sb.Append(RenderEmailTableRow("Bill Day of Month", s.CurrentPlanDayOfMonth.ToString())); sb.Append(RenderEmailTableRow("Bill Rate", s.CurrentPlanRate.ToString("c"))); sb.Append(RenderEmailTableRow("Percentage", s.CurrentPlanPercent.ToString())); sb.Append("</table>"); sb.Append(" <br />"); sb.Append(" <br />"); sb.Append("</div></body></html>"); m.IsBodyHtml = true; m.Body = sb.ToString(); Accounts.Store tempStore = new Accounts.Store(); MailServices sender = new MailServices(tempStore); sender.SendMail(m); }
public string GetDefaultLink(Accounts.Store currentStore) { string result = ""; result = currentStore.RootUrl(); result += "?" + WebAppSettings.AffiliateQueryStringName + "=" + this.ReferralId; return(result); }
public static void SendAccountInformation(Accounts.UserAccount u, Accounts.Store s) { Accounts.Store tempStore = new Accounts.Store(); MailServices sender = new MailServices(tempStore); if (u == null || s == null) { return; } string fromEmail = WebAppSettings.ApplicationEmail; if (WebAppSettings.IsIndividualMode) { fromEmail = s.Settings.MailServer.FromEmail; } MailMessage m = new MailMessage(fromEmail, u.Email); m.Subject = s.StoreName + " Account Reminder Information"; StringBuilder sb = new StringBuilder(); sb.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); sb.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\" >"); sb.Append("<head><title>BV Commerce Account Information Reminder</title>"); sb.Append(RenderEmailHtmlStyles()); sb.Append("</head><body><div style=\"padding:20px;\">"); sb.Append("<h1>Account Information</h1>"); sb.Append("<p>Thank you for creating a MerchantTribe store. Your account information appears below:</p>"); sb.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">"); sb.Append(RenderEmailTableRow("Email", u.Email)); // Passwords are now hashed so we can't send them. //sb.Append(RenderEmailTableRow("Password", u.Password)); sb.Append(RenderEmailTableRow("Store Name", s.StoreName)); sb.Append(RenderEmailTableRowLink("Store URL", s.RootUrl(), s.RootUrl())); sb.Append(RenderEmailTableRowLink("Store Admin URL", s.RootUrl() + "admin", s.RootUrl() + "admin")); sb.Append("</table>"); sb.Append(" <br />"); sb.Append(" <br />"); sb.Append("</div></body></html>"); m.IsBodyHtml = true; m.Body = sb.ToString(); sender.SendMail(m); }
public List <HtmlTemplateTag> DefaultReplacementTags(MerchantTribeApplication app) { List <HtmlTemplateTag> result = new List <HtmlTemplateTag>(); Accounts.Store currentStore = app.CurrentStore; result.Add(new HtmlTemplateTag("[[Store.Address]]", app.ContactServices.Addresses.FindStoreContactAddress().ToHtmlString())); result.Add(new HtmlTemplateTag("[[Store.ContactEmail]]", currentStore.Settings.MailServer.EmailForGeneral)); result.Add(new HtmlTemplateTag("[[Store.Logo]]", Utilities.HtmlRendering.Logo(app, false))); result.Add(new HtmlTemplateTag("[[Store.SecureUrl]]", currentStore.RootUrlSecure())); result.Add(new HtmlTemplateTag("[[Store.StoreName]]", currentStore.StoreName)); result.Add(new HtmlTemplateTag("[[Store.StandardUrl]]", currentStore.RootUrl())); result.Add(new HtmlTemplateTag("[[Store.CurrentLocalTime]]", DateTime.Now.ToString())); result.Add(new HtmlTemplateTag("[[Store.CurrentUtcTime]]", DateTime.UtcNow.ToString())); return(result); }