public void SendMail(string strOrderNo, string strName, string strMobile, string strEmail, bool IsSuccess, string strTransctionId, string strBankRef) { try { if (Session[appFunctions.Session.PaymentEmailString.ToString()] != null) { if (Session[appFunctions.Session.PaymentEmailString.ToString()].ToString() != "") { objCommon = new clsCommon(); string Strbody = ""; string strSubject; if (IsSuccess) { strSubject = "Order confirmation- Your Order #" + strOrderNo + " with Fabymart has been successfully placed!"; } else { strSubject = "Order confirmation- Your Order #" + strOrderNo + " with Fabymart has Failed!"; } Strbody = Session[appFunctions.Session.PaymentEmailString.ToString()].ToString(); //Strbody = Strbody.Replace("`transction`", strTransctionId); //Strbody = Strbody.Replace("`bakRefNo`", strBankRef); if (IsSuccess) { //Strbody = Strbody.Replace("`status`", " is Successfully done "); Strbody = Strbody.Replace("`confirmed`", " now confirmed "); } else { //Strbody = Strbody.Replace("`status`", " has failed "); Strbody = Strbody.Replace("`confirmed`", " not confirmed "); } string strText = ""; if (IsSuccess) { strText = appFunctions.strOnlineOrderConfirmed; DInfo.ShowMessage("You Successfull Pay for order.", BusinessLayer.Enums.MessageType.Successfull); } else { strText = appFunctions.strOnlineOrderFailed; DInfo.ShowMessage("Your online payment Failed.", BusinessLayer.Enums.MessageType.Error); } strText = strText.Replace("`uname`", strName); strText = strText.Replace("`orderno`", strOrderNo); objCommon.SendOrderSMS(strText, strMobile); objCommon.SendConfirmationMail(strEmail, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); //objCommon.SendMail(strEmail, strSubject, Strbody); objCommon = null; Session[appFunctions.Session.PaymentEmailString.ToString()] = ""; } } } catch (Exception ex) { //Response.Write(ex.StackTrace.ToString()); } }
public bool SendPassword() { tblCustomer objCustomer = new tblCustomer(); objCustomer.Where.AppEmailID.Value = txtEmail.Text; objCustomer.Query.Load(); if (objCustomer.RowCount > 0) { clsCommon objCommon = new clsCommon(); clsEncryption objEncrypt = new clsEncryption(); string StrBody = ""; string strSubject = "Password Recovery Request"; StrBody = objCommon.readFile(Server.MapPath("~/EmailTemplates/ForgetPassword.html")); StrBody = StrBody.Replace("`email`", objCustomer.AppEmailID); StrBody = StrBody.Replace("`password`", objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey.ToString())); objCommon.SendConfirmationMail(objCustomer.AppEmailID, strSubject, StrBody, Enums.Enum_Confirmation_Mail_type.register); objEncrypt = null; objCommon = null; txtEmail.Text = ""; } else { DInfo.ShowMessage("Invalid email address, Please enter registered email.", Enums.MessageType.Error); return(false); } objCustomer = null; return(true); }
private void SendMail(string strOrderID) { try { tblOrder objOrder = new tblOrder(); objDataTable = objOrder.GetOrderInfo(strOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.Confirmed).ToString(), Convert.ToInt32(Enums.PaymentMode.COD).ToString()); if (objDataTable.Rows.Count > 0) { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Order confirmation- Your COD Order #" + objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString() + " with Fabymart has been successfully placed!"; Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/CODOrderConfirmation.html")); Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`uname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); Strbody = Strbody.Replace("`orderno`", objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString()); Strbody = Strbody.Replace("`name`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); Strbody = Strbody.Replace("`address`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverAddress].ToString()); Strbody = Strbody.Replace("`city`", objDataTable.Rows[0][tblCity.ColumnNames.AppCity].ToString()); Strbody = Strbody.Replace("`pincode`", "-" + objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverPIN].ToString()); Strbody = Strbody.Replace("`state`", objDataTable.Rows[0][tblState.ColumnNames.AppState].ToString()); Strbody = Strbody.Replace("`country`", ", " + objDataTable.Rows[0][tblCountry.ColumnNames.AppCountry].ToString()); Strbody = Strbody.Replace("`mobile`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString()); Strbody = Strbody.Replace("`email`", " " + objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString()); string strTable = ""; foreach (DataRow row in objDataTable.Rows) { strTable += "<tr>"; strTable += "<td align=\"left\" style=\"text-transform: capitalize\" width=\"100\"><img src=\"" + strServerURL + "admin/" + row[tblProductImage.ColumnNames.AppSmallImage].ToString() + "\" width=\"100\" /></td>"; strTable += "<td align=\"left\" style=\"text-transform: capitalize\" ><a target=\"_blank\" href=\"" + GetAlias("ProductDetail.aspx") + generateUrl(row[tblProduct.ColumnNames.AppProductName].ToString()) + " \">" + row[tblProduct.ColumnNames.AppProductName].ToString() + "</a><br />Sku no :" + row[tblProductDetail.ColumnNames.AppSKUNo].ToString() + " </td>"; strTable += "<td align=\"right\" width=\"60\">Rs " + row["appRealPrice"].ToString() + " </td>"; strTable += "<td align=\"right\" width=\"80\">" + row["appQty"].ToString() + "</td>"; strTable += "<td align=\"right\" width=\"60\">Rs " + row["appDiscountPrice"].ToString() + " </td>"; strTable += "<td align=\"right\" width=\"60\">Rs " + row["appTotalPrice"].ToString() + " </td>"; strTable += "</tr>"; } Strbody = Strbody.Replace("`table`", strTable); Strbody = Strbody.Replace("`Shipping`", "Rs. " + "0"); Strbody = Strbody.Replace("`COD`", "Rs. " + "0"); Strbody = Strbody.Replace("`Discounts`", "Rs. " + objDataTable.Compute("sum(appDiscountPrice)", "").ToString()); Strbody = Strbody.Replace("`Total`", "Rs. " + objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderAmount].ToString()); string strText = appFunctions.strOrderConfirmed; strText = strText.Replace("`uname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); strText = strText.Replace("`orderno`", objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString()); objCommon.SendOrderSMS(strText, objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString()); //objCommon.SendMail(objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString(), strSubject, Strbody); objCommon.SendConfirmationMail(objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString(), strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); objCommon = null; } objOrder = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
private void SendMail(int strStatus, string strOrderID) { try { tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderID))) { if (objOrder.AppOrderStatusID == Convert.ToInt32(Enums.Enums_OrderStatus.Delivered)) { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Order Delivered - Your fabymart Order #" + objOrder.s_AppOrderNo + " has been delivered"; if (objOrder.AppPaymentMode == Convert.ToInt32(Enums.PaymentMode.COD)) { Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/CODOrderDelivered.html")); } else { Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/OrderDelivered.html")); } Strbody = Strbody.Replace("`orderno`", objOrder.s_AppOrderNo); Strbody = Strbody.Replace("`uname`", objOrder.AppReceiverName); Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`Date`", objOrder.AppOrderStatusChangeDate.ToString("dd-MM-yyyy")); objCommon.SendConfirmationMail(objOrder.AppRecevierEmail, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); //objCommon.SendMail(objOrder.AppRecevierEmail, strSubject, Strbody); string strText = appFunctions.strOrderDelivered; strText = strText.Replace("`uname`", objOrder.AppReceiverName); strText = strText.Replace("`orderno`", objOrder.AppOrderNo); strText = strText.Replace("`deliverydate`", objOrder.AppOrderStatusChangeDate.ToString("dd-MM-yyyy")); objCommon.SendOrderSMS(strText, objOrder.AppReceiverContactNo1); objCommon = null; } } objOrder = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
public void SendMail(string strId) { try { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Account Activation Process"; Strbody = objCommon.readFile(Server.MapPath("~/EmailTemplates/NewUserMail.html")); Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`uname`", txtFirstName.Text + " " + txtLastName.Text); objEncrypt = new clsEncryption(); Strbody = Strbody.Replace("`linkActive`", GetAlias("Approved.aspx") + objEncrypt.Encrypt(strId, appFunctions.strKey)); objEncrypt = null; objCommon.SendConfirmationMail(txtEmailRegistration.Text, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.register); //objCommon.SendMail(txtEmailRegistration.Text, strSubject, Strbody); objCommon = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
private void SendMail(int strStatus, string strOrderID) { string strEmail = ""; try { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Fabymart.com order confirmed - " + strOrderID; Strbody = objCommon.readFile(Server.MapPath("~/EmailTemplates/OrderConfirmation.html")); Strbody = Strbody.Replace("`orderno`", strOrderID); if (strStatus == Convert.ToInt32(Enums.Enums_OrderStatus.Complete)) { Strbody = Strbody.Replace("`orderstatus`", "Complete"); } else if (strStatus == Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin)) { Strbody = Strbody.Replace("`orderstatus`", "Cancelled By FabyMart"); } Strbody = Strbody.Replace("`orderdate`", GetCurrentDateTime().ToString()); tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderID))) { strEmail = objOrder.AppRecevierEmail; } objOrder = null; objCommon.SendConfirmationMail(strEmail, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); strEmail = ""; objCommon = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
private void SendShippingMail(string strOrderID) { try { tblOrder objOrder = new tblOrder(); objDataTable = objOrder.GetShippedOrderInfo(strOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString()); if (objDataTable.Rows.Count > 0) { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Order Shipped- Your order #" + objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString() + " has been shipped!"; if (Convert.ToInt32(objDataTable.Rows[0][tblOrder.ColumnNames.AppPaymentMode].ToString()) == Convert.ToInt32(Enums.PaymentMode.COD)) { Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/CODOrderShipped.html")); } else { Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/OrderShipped.html")); } Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`uname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); Strbody = Strbody.Replace("`orderno`", objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString()); Strbody = Strbody.Replace("`date`", Convert.ToDateTime(objDataTable.Rows[0][tblOrder.ColumnNames.AppCreatedDate].ToString()).ToString("MMMM dd, yyyy HH:MM:ss tt")); Strbody = Strbody.Replace("`ShippedBy`", objDataTable.Rows[0][tblCourierCompany.ColumnNames.AppCourierCompany].ToString()); Strbody = Strbody.Replace("`TrackingNumber`", objDataTable.Rows[0][tblSubOrder.ColumnNames.AppDocketNo].ToString()); Strbody = Strbody.Replace("`name`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); Strbody = Strbody.Replace("`address`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverAddress].ToString()); Strbody = Strbody.Replace("`city`", objDataTable.Rows[0][tblCity.ColumnNames.AppCity].ToString()); Strbody = Strbody.Replace("`state`", objDataTable.Rows[0][tblState.ColumnNames.AppState].ToString()); Strbody = Strbody.Replace("`country`", objDataTable.Rows[0][tblCountry.ColumnNames.AppCountry].ToString()); Strbody = Strbody.Replace("`pincode`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverPIN].ToString()); Strbody = Strbody.Replace("`mobile`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString()); Strbody = Strbody.Replace("`email`", objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString()); Strbody = Strbody.Replace("`billname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverName].ToString()); Strbody = Strbody.Replace("`billaddress`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverAddress].ToString()); Strbody = Strbody.Replace("`billcity`", objDataTable.Rows[0]["AppBillCity"].ToString()); Strbody = Strbody.Replace("`billstate`", objDataTable.Rows[0]["AppBillState"].ToString()); Strbody = Strbody.Replace("`billcountry`", objDataTable.Rows[0]["AppBillCountry"].ToString()); Strbody = Strbody.Replace("`billpincode`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverPIN].ToString()); Strbody = Strbody.Replace("`billmobile`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverContactNo1].ToString()); Strbody = Strbody.Replace("`billemail`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillRecevierEmail].ToString()); objCommon.SendConfirmationMail(objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString(), strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); //objCommon.SendMail(objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString(), strSubject, Strbody); string strText = ""; if (Convert.ToInt32(objDataTable.Rows[0][tblOrder.ColumnNames.AppPaymentMode].ToString()) == Convert.ToInt32(Enums.PaymentMode.COD)) { strText = appFunctions.strOrderShipped; } else { strText = appFunctions.strOrderShipped; } strText = strText.Replace("`uname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); strText = strText.Replace("`orderno`", objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString()); strText = strText.Replace("`couriername`", objDataTable.Rows[0][tblCourierCompany.ColumnNames.AppCourierCompany].ToString()); strText = strText.Replace("`trackingno`", objDataTable.Rows[0][tblSubOrder.ColumnNames.AppDocketNo].ToString()); objCommon.SendOrderSMS(strText, objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString()); objCommon = null; } objOrder = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }