Exemplo n.º 1
0
    public static void SendApprovalConfirmation(string emailTo, string loginName, string firstName, string lastName)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\AccountApproved.txt"));

      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;
      template.Data.Add("{{loginName}}", loginName);
      template.Data.Add("{{firstName}}", firstName);
      template.Data.Add("{{lastName}}", lastName);
      ParseCommonData(template);
      UniMail.Mailer.Send(template.Render());
    }
Exemplo n.º 2
0
 public static void SendOutBidLetter(string FirstName, string LastName, string emailTo, string lot, string auctionName, string currentSuccessfulBid, string auctionEndDate, string newBidUrl)
 {
   UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\outBid.txt"));
   template.Encoding = System.Text.Encoding.UTF8;
   template.ToEmail = emailTo;      
   template.Data.Add("{{lot}}", lot);
   template.Data.Add("{{auctionName}}", auctionName);
   template.Data.Add("{{currentSuccessfulBid}}", currentSuccessfulBid);
   template.Data.Add("{{auctionEndDate}}", auctionEndDate);
   template.Data.Add("{{newBidUrl}}", newBidUrl);
   template.Data.Add("{{firstName}}", FirstName);
   template.Data.Add("{{lastName}}", LastName);
   ParseCommonData(template);
   UniMail.Mailer.Enqueue(template.Render());
 }
Exemplo n.º 3
0
    public static void SendOutBidMultipleLetter(string emailTo, long auctionID, string loginName, string auctionName, string currentSuccessfulBid, string auctionEndDate, string newBidUrl)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\outBidMultiple.txt"));

      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;
      template.Data.Add("{{auctionID}}", auctionID.ToString());
      template.Data.Add("{{loginName}}", loginName);
      template.Data.Add("{{auctionName}}", auctionName);
      template.Data.Add("{{currentSuccessfulBid}}", currentSuccessfulBid);
      template.Data.Add("{{auctionEndDate}}", auctionEndDate);
      template.Data.Add("{{newBidUrl}}", ConfigurationManager.AppSettings["siteUrl"] + newBidUrl);


      ParseCommonData(template);

      UniMail.Mailer.Send(template.Render());
    }
Exemplo n.º 4
0
    public static void SendMessageFromConsignor(string FirstName, string LastName, string Email, string Phone, string BestTime, string Description)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\MessageFromConsignor.txt"));
      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = ConfigurationManager.AppSettings["ConsignorMessagesEmail"];
      template.Data.Add("{{firstname}}", FirstName);
      template.Data.Add("{{lastname}}", LastName);
      template.Data.Add("{{email}}", Email);
      template.Data.Add("{{phone}}", Phone);
      template.Data.Add("{{best}}", BestTime);
      template.Data.Add("{{description}}", Description);
      ParseCommonData(template);

      UniMail.Mailer.Send(template.Render());
    }
Exemplo n.º 5
0
    public static void SendSuccessfulBidUpdateLetter(string FirstName, string LastName, string emailTo, string lot, string auctionName, string usersbid, string usersmaxbid, string auctionEndDate, string newBidUrl, bool IsMaxBidOrAmount)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\bidUpdate.txt"));
      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;      
      template.Data.Add("{{lot}}", lot);
      template.Data.Add("{{auctionName}}", auctionName);
      template.Data.Add("{{usersbid}}", usersbid);
      template.Data.Add("{{usersmaxbid}}", usersmaxbid);
      template.Data.Add("{{auctionEndDate}}", auctionEndDate);
      template.Data.Add("{{newBidUrl}}", newBidUrl);
      template.Data.Add("{{firstName}}", FirstName);
      template.Data.Add("{{lastName}}", LastName);
      if (IsMaxBidOrAmount)
      {
        template.Data.Add("{{change_maxbid}}", "maximum bid was raised to");
        template.Data.Add("{{was_not_change_maxbid}}", "");
        template.Data.Add("{{change_bid}}", "current bid in the amount of");
        template.Data.Add("{{was_not_change_bid}}", "was not change");
      }
      else
      {
        template.Data.Add("{{change_maxbid}}", "current maximum bid in the amount of");
        template.Data.Add("{{was_not_change_maxbid}}", "was not change");
        template.Data.Add("{{change_bid}}", "bid was raised to");
        template.Data.Add("{{was_not_change_bid}}", "");
      }
      ParseCommonData(template);

      UniMail.Mailer.Enqueue(template.Render()); ;
    }
Exemplo n.º 6
0
    public static void SendEndOfAuctionLetter(string emailTo, long auctionID, string loginName, string auctionName, string auctionEndDate, string newBidUrl)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\endOfAuction.txt"));

      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;
      template.Data.Add("{{auctionID}}", auctionID);
      template.Data.Add("{{loginName}}", loginName);

      template.Data.Add("{{auctionName}}", auctionName);
      template.Data.Add("{{auctionEndDate}}", auctionEndDate);
      template.Data.Add("{{newBidUrl}}", newBidUrl);

      ParseCommonData(template);

      UniMail.Mailer.Send(template.Render()); ;
    }
Exemplo n.º 7
0
    internal static void SendMailTheLot(string emailTo, string loginName, string ownerEmail, string messageText, long auctionID, string auctionTitle, string auctionDescription, string auctionUrl)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\MailTheLot.txt"));

      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;
      template.Data.Add("{{loginName}}", loginName);
      template.Data.Add("{{ownerEmail}}", ownerEmail);
      template.Data.Add("{{messageText}}", messageText);

      template.Data.Add("{{auctionID}}", auctionID);
      template.Data.Add("{{auctionTitle}}", auctionTitle);
      template.Data.Add("{{auctionDescription}}", auctionDescription);
      template.Data.Add("{{auctionUrl}}", auctionUrl);

      ParseCommonData(template);

      UniMail.Mailer.Send(template.Render()); ;
    }
Exemplo n.º 8
0
        public static void SendWinningLetter(string FirstName, string LastName, string emailTo, long auctionID, string auctionName, string usersbid)
        {
            UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\winningBid.txt"));

              template.Encoding = System.Text.Encoding.UTF8;
              template.ToEmail = emailTo;
              template.Data.Add("{{auctionID}}", auctionID);
              template.Data.Add("{{auctionName}}", auctionName);
              template.Data.Add("{{usersbid}}", usersbid);
              //template.Data.Add("{{usersmaxbid}}", usersmaxbid);
              template.Data.Add("{{firstName}}", FirstName);
              template.Data.Add("{{lastName}}", LastName);
              ParseCommonData(template);

              UniMail.Mailer.Enqueue(template.Render());
        }
Exemplo n.º 9
0
        //SendEndOfAuctionHTMLLetter
        public static void SendEndOfAuctionHTMLLetter(string email, EndOfAuction eoa)
        {
            UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\EndOfAuctionNoticeHTML.txt"), "mail");
              string emailTitle = (eoa.Invoices.Count() > 0 ? "Winning Auction Notification for " : "End of Auction Notice for ") + eoa.EventTitle;
              template.Subject = emailTitle;
              template.Encoding = Encoding.UTF8;
              template.ToEmail = email;

              template.Data.Add("{{email_subject}}", emailTitle);
              template.Data.Add("{{email_title}}", eoa.Invoices.Count() > 0 ? "Congratulations!" : emailTitle);
              if (eoa.Invoices.Count() > 0)
              template.Data.Add("{{email_title_2}}", eoa.UserName + ",<br />" + String.Format("Please send your payment to:<br />Lelands Collectibles, Inc.<br /> 130 Knickerbocker Avenue<br /> Suite E <br />Bohemia, NY 11716 <br /><br />International winners please contact [email protected] before sending payment to receive your international shipping cost. <br /><br />You can also preview your invoice online in your account or follow <a style='font-weight:bold;color:#6C0202' href='{2}/Account/InvoiceDetailed/{0}/{1}'>this link</a>.", eoa.Invoices.First().UserInvoice_ID, eoa.Invoices.First().LinkParams.EventUrl, "{{siteUrl}}") + "<br /><br />You are the winning bidder for the following auction item(s).");
              else template.Data.Add("{{email_title_2}}", "This email is sent as a courtesy to let you know that this auction has ended.");

              StringBuilder table;

              if (eoa.Invoices.Count() > 0)
              {
            #region Invoices
            table = new StringBuilder();

            table.AppendLine("<span style='color:#490202'><strong>Winning Item Invoice</strong></span>");
            table.AppendLine("<table style='table-layout:fixed;font-size:12px;' cellpadding='0' cellspacing='0' >");
            table.AppendLine("<colgroup><col width='80px' /><col width='510px' /><col width='140px' /></colgroup>");
            table.AppendLine("<tr>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Lot#</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Title</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Cost</td>");
            table.AppendLine("</tr>");

            foreach (InvoiceDetail invoice in eoa.Invoices)
            {
              table.AppendLine("<tr>");
              table.AppendFormat("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{0}</td>", invoice.LinkParams.Lot);
              table.AppendFormat("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{0}</td>", invoice.LinkParams.Title);
              table.AppendFormat("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{0}</td>", invoice.Cost.GetCurrency());
              table.AppendLine("</tr>");
            }
            table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Net Cost*", eoa.TotalCst.GetCurrency(false));
            table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Shipping, Handiling & Insurance", eoa.TotalShippingString);
            table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Sales Tax", eoa.TotalTax.GetCurrency(false));
            table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Late Fees", eoa.TotalLateFee.GetCurrency(false));
            table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Total Due", eoa.TotalCostString);
            table.AppendLine("</table>* Auction items include premium");
            template.Data.Add("{{invoices_info}}", table.ToString());
            #endregion
              }
              else
            template.Data.Add("{{invoices_info}}", String.Empty);

              template.Data.Add("{{separator}}", (eoa.Invoices.Count() > 0 && eoa.LoserLots.Count() > 0) ? "<br /><hr /><br />" : String.Empty);

              if (eoa.LoserLots.Count() > 0)
              {
            table = new StringBuilder();
            table.AppendLine("<p>Unfortunately, you were not a successful bidder for lot(s)</p>");
            table.AppendLine("<table style='table-layout:fixed;font-size:14px' cellpadding='0' cellspacing='0' >");
            table.AppendLine("<colgroup><col width='80px' /><col width='290px' /><col width='100px' /><col width='100px' /><col width='100px' /><col width='60px' /></colgroup>");
            table.AppendLine("<tr>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Lot#</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Title</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Winning Bid</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Your Bid</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Your MaxBid</td>");
            table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Bids</td>");
            table.AppendLine("</tr>");
            foreach (UserBidWatch ubw in eoa.LoserLots)
            {
              table.AppendLine("<tr>");
              table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.LinkParams.Lot + "</td>");
              table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.LinkParams.Title + "</td>");
              table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.CurrentBid.GetCurrency() + "</td>");
              table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.Amount.GetCurrency() + "</td>");
              table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.MaxBid.GetCurrency() + "</td>");
              table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.Bids + "</td>");
              table.AppendLine("</tr>");
            }
            table.AppendLine("</table><br />");

            template.Data.Add("{{loserlots}}", table.ToString());
              }
              else
            template.Data.Add("{{loserlots}}", String.Empty);

              ParseCommonData(template);
              UniMail.Mailer.Enqueue(template.RenderHTML(), "mail");
        }
Exemplo n.º 10
0
 public static void ForgotPassword(string emailTo, string loginName, string password, string url)
 {
   UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\passwordReset.txt"));
   template.Encoding = System.Text.Encoding.UTF8;
   template.ToEmail = emailTo;
   template.Data.Add("{{loginName}}", loginName);
   template.Data.Add("{{password}}", password);
   template.Data.Add("{{confirmurl}}", url);
   ParseCommonData(template);      
   UniMail.Mailer.Send(template.Render());
 }
Exemplo n.º 11
0
        public static void Temp_SendInvoiceInformationLetter2(string FirstName, string LastName, string emailTo, string auctionenddate, string userinvoice_id, string salesdate, string eventurl, List<Invoice> invoices, decimal amountpaid)
        {
            UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\UserInvoice.txt"));
              template.Encoding = System.Text.Encoding.UTF8;
              template.ToEmail = emailTo;
              template.Data.Add("{{firstName}}", FirstName);
              template.Data.Add("{{lastName}}", LastName);
              template.Data.Add("{{auctionenddate}}", auctionenddate);
              template.Data.Add("{{UserInvoice_ID}}", userinvoice_id);
              template.Data.Add("{{SaleDate}}", salesdate);
              template.Data.Add("{{EventURL}}", eventurl);

              bool line = true;
              decimal sumcost = 0;
              decimal sumshipping = 0;
              decimal sumtax = 0;
              decimal sumfees = 0;
              decimal tmp = 0;
              bool isnotshipment = false;
              tmp = amountpaid;
              StringBuilder info = new StringBuilder();

              foreach (var item in invoices)
              {
            if (item.Shipping == 0) isnotshipment = true;
            info.AppendLine(((line)
                           ? "<tr style=\"background-color:#EFEFEF\" class=\"bordered\">"
                           : "<tr class=\"bordered\">"));
            info.AppendLine("<td style='padding-left: 5px; border:1px solid #444'>" + item.Auction.Lot.ToString() + "</td>");
            info.AppendLine("<td style='padding-left: 5px; border:1px solid #444'>" + item.Auction.Title + "</td>");
            info.AppendLine("<td style='padding-left: 5px; border:1px solid #444'>" + item.Cost.GetCurrency() + "</td>");
            info.AppendLine("</tr>");
            line = !line;
            sumcost += item.Cost;
            sumshipping += item.Shipping;
            sumtax += item.Tax;
            sumfees += item.LateFee;
              }
              info.AppendLine("<tr><td colspan=\"2\" style=\"text-align:right; font-weight:bold\">Net Cost*:&nbsp;</td><td>"+sumcost.GetCurrency()+"</td></tr>");
              info.AppendLine("<tr><td colspan=\"2\" style=\"text-align:right; font-weight:bold\">Shipping, Handiling & Insurance:&nbsp;</td><td>" + ((sumshipping == 0 || isnotshipment) ? "not calculated yet" : sumshipping.GetCurrency()) + "</td></tr>");
              info.AppendLine("<tr><td colspan=\"2\" style=\"text-align:right; font-weight:bold\">Sales Tax:&nbsp;</td><td>" + ((sumtax == 0) ? "$0.00" : sumtax.GetCurrency()) + "</td></tr>");
              info.AppendLine("<tr><td colspan=\"2\" style=\"text-align:right; font-weight:bold\">Late Fees:&nbsp;</td><td>" + ((sumfees == 0) ? "$0.00" : sumfees.GetCurrency()) + "</td></tr>");
              info.AppendLine("<tr><td colspan=\"2\" style=\"text-align:right; font-weight:bold\">Amount Paid:&nbsp;</td><td>" + ((tmp == 0) ? "$0.00" : tmp.GetCurrency()) + "</td></tr>");
              tmp = sumcost + sumfees + sumshipping + sumtax - tmp;
              info.AppendLine("<tr><td colspan=\"2\" style=\"text-align:right; font-weight:bold\">Amount Due:&nbsp;</td><td>" + ((tmp < 0 || (sumshipping == 0 || isnotshipment)) ? "not calculated yet" : tmp.GetCurrency(false)) + "</td></tr>");

              template.Data.Add("{{info}}", info.ToString());
              ParseCommonData(template);
              UniMail.Mailer.Enqueue(template.RenderHTML());
        }
Exemplo n.º 12
0
 //public static void SendInvoice(string emailTo, string invoice_id)
 //{
 //  UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\Invoices.txt"));
 //  template.Encoding = System.Text.Encoding.UTF8;
 //  template.ToEmail = emailTo;
 //  ParseCommonData(template);
 //  UniMail.Mailer.Enqueue(template.Render(HttpContext.Current.Server.MapPath(@"~\Pool\Invoices\"+invoice_id+".pdf"))); ;
 //}
 public static void Temp_SendInvoiceInformationLetter(string FirstName, string LastName, string emailTo, string invoice_id)
 {
     UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\PreviewAuctionInvoice.txt"));
       template.Encoding = System.Text.Encoding.UTF8;
       template.ToEmail = emailTo;
       template.Data.Add("{{firstName}}", FirstName);
       template.Data.Add("{{lastName}}", LastName);
       template.Data.Add("{{invoice_id}}", invoice_id);
       ParseCommonData(template);
       UniMail.Mailer.Enqueue(template.Render());
 }
Exemplo n.º 13
0
 public static void Temp_SendConsignmentInformationLetter(string FirstName, string LastName, string emailTo, string consignment_id, string eventname, string auctionenddate)
 {
     UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\Consignments.txt"));
       template.Encoding = System.Text.Encoding.UTF8;
       template.ToEmail = emailTo;
       template.Data.Add("{{firstName}}", FirstName);
       template.Data.Add("{{lastName}}", LastName);
       template.Data.Add("{{invoice_id}}", consignment_id);
       template.Data.Add("{{eventname}}", eventname);
       template.Data.Add("{{auctionenddate}}", auctionenddate);
       ParseCommonData(template);
       UniMail.Mailer.Enqueue(template.Render());
 }
Exemplo n.º 14
0
    public static void ResendConfirmationCode(string emailTo, string loginName, string confirmationUrl)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\resendConfirmationCode.txt"));

      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;
      template.Data.Add("{{loginName}}", loginName);
      template.Data.Add("{{confirmation}}", confirmationUrl);
      ParseCommonData(template);
      UniMail.Mailer.Send(template.Render());
    }
Exemplo n.º 15
0
    public static void SendFreeEmailRegisterConfirmation(string emailTo, string firstName, string lastName, string url)
    {
      UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\registerFreeEmailConfirm.txt"));

      template.Encoding = System.Text.Encoding.UTF8;
      template.ToEmail = emailTo;
      template.Data.Add("{{FirstName}}", firstName);
      template.Data.Add("{{LastName}}", lastName);
      template.Data.Add("{{Url}}", url);
      ParseCommonData(template);
      UniMail.Mailer.Send(template.Render()); ;
    }
Exemplo n.º 16
0
        //SendEndOfAuctionHTMLLetter
        public static void SendEndOfAuctionHTMLLetter(string email, EndOfAuction eoa)
        {
            UniMail.Template template   = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\EndOfAuctionNoticeHTML.txt"), "mail");
            string           emailTitle = (eoa.Invoices.Count() > 0 ? "Winning Auction Notification for " : "End of Auction Notice for ") + eoa.EventTitle;

            template.Subject  = emailTitle;
            template.Encoding = Encoding.UTF8;
            template.ToEmail  = email;

            template.Data.Add("{{email_subject}}", emailTitle);
            template.Data.Add("{{email_title}}", eoa.Invoices.Count() > 0 ? "Congratulations!" : emailTitle);
            if (eoa.Invoices.Count() > 0)
            {
                template.Data.Add("{{email_title_2}}", eoa.UserName + ",<br />" + String.Format("Please send your payment to:<br />Lelands Collectibles, Inc.<br /> 130 Knickerbocker Avenue<br /> Suite E <br />Bohemia, NY 11716 <br /><br />International winners please contact [email protected] before sending payment to receive your international shipping cost. <br /><br />You can also preview your invoice online in your account or follow <a style='font-weight:bold;color:#6C0202' href='{2}/Account/InvoiceDetailed/{0}/{1}'>this link</a>.", eoa.Invoices.First().UserInvoice_ID, eoa.Invoices.First().LinkParams.EventUrl, "{{siteUrl}}") + "<br /><br />You are the winning bidder for the following auction item(s).");
            }
            else
            {
                template.Data.Add("{{email_title_2}}", "This email is sent as a courtesy to let you know that this auction has ended.");
            }

            StringBuilder table;

            if (eoa.Invoices.Count() > 0)
            {
                #region Invoices
                table = new StringBuilder();

                table.AppendLine("<span style='color:#490202'><strong>Winning Item Invoice</strong></span>");
                table.AppendLine("<table style='table-layout:fixed;font-size:12px;' cellpadding='0' cellspacing='0' >");
                table.AppendLine("<colgroup><col width='80px' /><col width='510px' /><col width='140px' /></colgroup>");
                table.AppendLine("<tr>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Lot#</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Title</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Cost</td>");
                table.AppendLine("</tr>");

                foreach (InvoiceDetail invoice in eoa.Invoices)
                {
                    table.AppendLine("<tr>");
                    table.AppendFormat("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{0}</td>", invoice.LinkParams.Lot);
                    table.AppendFormat("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{0}</td>", invoice.LinkParams.Title);
                    table.AppendFormat("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{0}</td>", invoice.Cost.GetCurrency());
                    table.AppendLine("</tr>");
                }
                table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Net Cost*", eoa.TotalCst.GetCurrency(false));
                table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Shipping, Handiling & Insurance", eoa.TotalShippingString);
                table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Sales Tax", eoa.TotalTax.GetCurrency(false));
                table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Late Fees", eoa.TotalLateFee.GetCurrency(false));
                table.AppendFormat("<tr><td style='font-weight:bold;color:#490202;padding: 5px 5px 5px 10px; text-align:right;font-size:12px;' colspan='2'>{0}:&nbsp;&nbsp;</td><td style='font-weight:bold;color:#222;padding: 5px 0px 5px 10px;font-size:12px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>{1}</td></tr>", "Total Due", eoa.TotalCostString);
                table.AppendLine("</table>* Auction items include premium");
                template.Data.Add("{{invoices_info}}", table.ToString());
                #endregion
            }
            else
            {
                template.Data.Add("{{invoices_info}}", String.Empty);
            }


            template.Data.Add("{{separator}}", (eoa.Invoices.Count() > 0 && eoa.LoserLots.Count() > 0) ? "<br /><hr /><br />" : String.Empty);

            if (eoa.LoserLots.Count() > 0)
            {
                table = new StringBuilder();
                table.AppendLine("<p>Unfortunately, you were not a successful bidder for lot(s)</p>");
                table.AppendLine("<table style='table-layout:fixed;font-size:14px' cellpadding='0' cellspacing='0' >");
                table.AppendLine("<colgroup><col width='80px' /><col width='290px' /><col width='100px' /><col width='100px' /><col width='100px' /><col width='60px' /></colgroup>");
                table.AppendLine("<tr>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Lot#</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Title</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Winning Bid</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Your Bid</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Your MaxBid</td>");
                table.AppendLine("<td style='font-weight:bold;background-color:#6C0202;color:#FFFFFF;padding: 5px 0px 5px 10px;font-size:12px;'>Bids</td>");
                table.AppendLine("</tr>");
                foreach (UserBidWatch ubw in eoa.LoserLots)
                {
                    table.AppendLine("<tr>");
                    table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.LinkParams.Lot + "</td>");
                    table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.LinkParams.Title + "</td>");
                    table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.CurrentBid.GetCurrency() + "</td>");
                    table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.Amount.GetCurrency() + "</td>");
                    table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.MaxBid.GetCurrency() + "</td>");
                    table.AppendLine("<td style='font-size:12px;font-weight:bold;padding: 5px 0px 5px 10px;background-color:#f4f4f4;border: solid 1px #e2e2e2'>" + ubw.Bids + "</td>");
                    table.AppendLine("</tr>");
                }
                table.AppendLine("</table><br />");

                template.Data.Add("{{loserlots}}", table.ToString());
            }
            else
            {
                template.Data.Add("{{loserlots}}", String.Empty);
            }

            ParseCommonData(template);
            UniMail.Mailer.Enqueue(template.RenderHTML(), "mail");
        }
Exemplo n.º 17
0
        public static void SendPulledOutLetter(string FirstName, string LastName, string emailTo, long auctionID, string auctionName)
        {
            UniMail.Template template = new UniMail.Template(HttpContext.Current.Server.MapPath(@"~\Templates\Mail\WithdrawnItem.txt"));

              template.Encoding = System.Text.Encoding.UTF8;
              template.ToEmail = emailTo;
              template.Data.Add("{{auctionID}}", auctionID);
              template.Data.Add("{{auctionName}}", auctionName);
              template.Data.Add("{{firstName}}", FirstName);
              template.Data.Add("{{lastName}}", LastName);
              ParseCommonData(template);

              UniMail.Mailer.Enqueue(template.Render());
        }