コード例 #1
0
        private static void SendMailPayment(long InvoiceID, byte InvoiceType)
        {
            string strFromEmail = System.Configuration.ConfigurationManager.AppSettings["PaymentEmail"].ToString();

            TransactionsModel.GetInvoiceByInvoiceID obj = TransactionsManager.EB_FetechInvoiceByInvoiceID(InvoiceID, InvoiceType);
            string strToEmail = obj.Email;
            string Invoice    = EntrebatorUtility.EncryptionAndDecryption.EncryptInvoice(InvoiceID.ToString());
            string strMessageBody;
            //  DateTime Exposedate = obj.InvoiceDate.AddDays(3);
            string strMailSubject           = "Proforma Invoice from  ONE ON ONE LINKS PRIVATE LIMITED";
            string InvoiceURL               = System.Configuration.ConfigurationManager.AppSettings["SiteUrl"] + "/PayInvoiceAmount.aspx?invid=" + Invoice;
            NameValueCollection mergeFields = new NameValueCollection();

            mergeFields.Add("**SiteURL**", ConfigurationManager.AppSettings["SiteUrl"].ToString());
            mergeFields.Add("**InvoiceID**", obj.InvoiceID.ToString());
            mergeFields.Add("**Name**", obj.Name);
            mergeFields.Add("**Email**", obj.Email);
            mergeFields.Add("**Mobile**", obj.Mobile);
            mergeFields.Add("**Address**", obj.Address);
            mergeFields.Add("**InvoiceDate**", obj.InvoiceDate.ToString("MM/dd/yyyy"));
            mergeFields.Add("**ActualAmount**", obj.ActualAmount.ToString());
            mergeFields.Add("**DiscAmount**", obj.DiscAmount.ToString());
            mergeFields.Add("**BeforeTaxAmount**", obj.BeforeTaxAmount.ToString());
            mergeFields.Add("**FinalAmount**", obj.FinalAmount.ToString());
            mergeFields.Add("**Terms**", obj.Terms);
            mergeFields.Add("**ClientGST**", obj.ClientGST);
            mergeFields.Add("**Description**", obj.Description);
            mergeFields.Add("**Quantity**", obj.Quantity.ToString());
            mergeFields.Add("**CGST**", obj.CGST.ToString());
            mergeFields.Add("**SGST**", obj.SGST.ToString());
            mergeFields.Add("**InvoiceURL**", InvoiceURL);
            // mergeFields.Add("**Exposedate**", Exposedate.ToString("MM/dd/yyyy"));
            strMessageBody = EntrebatorUtility.EmailUtils.GetMailBody("PaymntInvoice.html", mergeFields);
            try
            {
                EntrebatorUtility.SendGrid.SendInvoiceEmail(strFromEmail, strToEmail, strMailSubject, strMessageBody);
                //EntrebatorUtility.EmailUtils.SendInvoiceEmail(strFromEmail, strToEmail, strMailSubject, strMessageBody);
            }
            catch (Exception ex)
            {
                ErrorLogHelper.LogException(ex, Log.LoggingSeverity.Error);
            }
        }
コード例 #2
0
        private static void SendReceiptMail(long InvoiceID, byte InvoiceType)
        {
            string strFromEmail = System.Configuration.ConfigurationManager.AppSettings["PaymentEmail"].ToString();

            TransactionsModel.GetInvoiceByInvoiceID obj = TransactionsManager.EB_FetechInvoiceByInvoiceID(InvoiceID, InvoiceType);
            string strToEmail = obj.Email;
            string strMessageBody;
            string strMailSubject           = "Receipt from ONE ON ONE LINKS PRIVATE LIMITED";
            NameValueCollection mergeFields = new NameValueCollection();

            mergeFields.Add("**InvoiceID**", obj.InvoiceID.ToString());
            mergeFields.Add("**Name**", obj.Name);
            mergeFields.Add("**Email**", obj.Email);
            mergeFields.Add("**Mobile**", obj.Mobile);
            mergeFields.Add("**Address**", obj.Address);
            mergeFields.Add("**InvoiceDate**", obj.InvoiceDate.ToString("MM/dd/yyyy"));
            mergeFields.Add("**ActualAmount**", obj.ActualAmount.ToString());
            mergeFields.Add("**DiscAmount**", obj.DiscAmount.ToString());
            mergeFields.Add("**BeforeTaxAmount**", obj.BeforeTaxAmount.ToString());
            mergeFields.Add("**FinalAmount**", obj.FinalAmount.ToString());
            mergeFields.Add("**Terms**", obj.Terms);
            mergeFields.Add("**ClientGST**", obj.ClientGST);
            mergeFields.Add("**Description**", obj.Description);
            mergeFields.Add("**Quantity**", obj.Quantity.ToString());
            mergeFields.Add("**CGST**", obj.CGST.ToString());
            mergeFields.Add("**SGST**", obj.SGST.ToString());
            mergeFields.Add("**ChequeDate**", obj.ChequeDate.ToString("MM/dd/yyyy"));
            mergeFields.Add("**StrPaymentMode**", obj.StrPaymentStatus);
            mergeFields.Add("**ChequeAmount**", obj.ChequeAmount.ToString());
            strMessageBody = EntrebatorUtility.EmailUtils.GetMailBody("InvReceipt.html", mergeFields);
            try
            {
                EntrebatorUtility.SendGrid.SendInvoiceEmail(strFromEmail, strToEmail, strMailSubject, strMessageBody);
                // EntrebatorUtility.EmailUtils.SendInvoiceEmail(strFromEmail, strToEmail, strMailSubject, strMessageBody);
            }
            catch (Exception ex)
            {
                ErrorLogHelper.LogException(ex, Log.LoggingSeverity.Error);
            }
        }