public int SendOrderUserCantPayToAdmin(Order order) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; var domain = _Context.EntityContext.SettingsAll.Select(x => x.AdminEmail).FirstOrDefault(); var shop = LS.Get <Shop>().FirstOrDefault(x => x.ID == order.ShopID); if (shop == null) { shop = new Shop(); } var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var res = Tokenize(templateSystemName, domain, new List <object>() { order, shop , virtualUser }); return(res); }
public int SendNewOrderSMSToMember(Order order, Shop shop) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; if (shop.Phone != null || _isGetTokensOnly) { if (shop.Phone == null) { shop.Phone = ""; } var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var res = Tokenize(templateSystemName, (shop.Phone2 ?? shop.Phone).Replace(" ", "").Replace("-", "") + _SMSGateway, new List <object>() { order, virtualUser, shop }); return(res); } return(0); }
public int SendOrderChangedEmailToUser(Order order, List <OrderItem> changed, List <OrderItem> outOfStock) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; var productChangeds = new OrderChangedProductTable(changed); var productRemoved = new OrderRemovedProductTable(outOfStock); var shop = LS.Get <Shop>().FirstOrDefault(x => x.ID == order.ShopID); var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var res = Tokenize(templateSystemName, order.Email, new List <object>() { order , shop , virtualUser , productChangeds , productRemoved }); return(res); }
public int SendNewOrderEmailToMember(Order order, Shop shop) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var products = new OrderProductTable(order.ID); var res = Tokenize(templateSystemName, shop.Email, new List <object>() { order, virtualUser, shop, products }); return(res); }
public int SendOrderPayedEmailToMember(Order order, Shop shop) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var ordernote = _Context.EntityContext.OrderNotes.FirstOrDefault(o => o.OrderID == order.ID); var res = Tokenize(templateSystemName, shop.Email, new List <object>() { order, virtualUser, shop, ordernote }); return(res); }
public int SendQuestionsDeliveredToUser(Order order, Shop shop) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; //http://localhost:23416/poll/index?OrderID=30&ShopID=3 PollPageModel model = new PollPageModel(); var domain = _Context.EntityContext.SettingsAll.Select(x => x.Domain).FirstOrDefault(); model.PollUrl = string.Format("{0}://{1}/poll/index?OrderID={2}&ShopID={3}", "http", domain, order.ID.ToString(), shop.ID.ToString()); var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var res = Tokenize(templateSystemName, order.Email, new List <object>() { order, virtualUser, shop, model }); return(res); }
public int OrderQuestionedToMember(Order order, Shop shop, List <PollAnswer> Answers) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; var virtualUser = new User() { Email = order.Email, FirstName = order.FullName != null ? order.FullName : "", ID = order.UserID, Phone = order.Phone, UserName = order.Email }; var mailparams = new List <object>() { order, virtualUser, shop }; mailparams.AddRange(Answers); var res = Tokenize(templateSystemName, shop.Email, mailparams); return(res); }
public int SendUserPasswordEmailToUser(User user) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; var res = Tokenize(templateSystemName, user.Email, new List <object>() { user }); return(res); }
public int OrderCanceledSmsToUser(Order order, User user) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; if (user != null && user.Phone != null || _isGetTokensOnly) { if (user.Phone == null) { user.Phone = ""; } var res = Tokenize(templateSystemName, user.Phone.Replace(" ", "").Replace("-", "") + _SMSGateway, new List <object>() { order, user }); return(res); } return(0); }
public int CheckoutSmsConfirmSmsToUser(CheckoutData checkooutData, User user) { MethodBase method = MethodBase.GetCurrentMethod(); MailTemplateAttribute attr = (MailTemplateAttribute)method.GetCustomAttributes(typeof(MailTemplateAttribute), true)[0]; string templateSystemName = attr.TemplateSystemName; if (user != null && checkooutData.Phone != null || _isGetTokensOnly) { if (checkooutData.Phone == null) { checkooutData.Phone = ""; } var res = Tokenize(templateSystemName, checkooutData.Phone.Replace(" ", "").Replace("-", "") + _SMSGateway, new List <object>() { user, checkooutData }); return(res); } return(0); }