示例#1
0
        static string GetSellerTradeNotice(Trade trade, SkuView sku, string lang)
        {
            string smsTemplate = GetStoreBuyNoticeTemplate(lang);

            smsTemplate = smsTemplate.Replace("{TradeCode}", trade.TradeCode);
            smsTemplate = smsTemplate.Replace("{Name}", trade.BuyerUserName);
            smsTemplate = smsTemplate.Replace("{Number}", trade.BuyerPhoneNumber);
            smsTemplate = smsTemplate.Replace("{Quantity}", trade.Quantity.ToString());
            smsTemplate = smsTemplate.Replace("{SkuName}", sku.FullName);
            smsTemplate = smsTemplate.Replace("{Total}", trade.Total.ToString());
            smsTemplate = smsTemplate.Replace("{Currency}", trade.Currency);
            return(smsTemplate);
        }
示例#2
0
        public static void SendBuyerFeedbackSms(Trade trade, SkuView sku)
        {
            string feedbackUrl = String.Format(@"{0}/zh-TW/buyerfeedback/{1}", WebApplication.Instance.WebUrl, trade.Guid);
            string shortUrl    = Google.GetShortUrl(feedbackUrl, WebApplication.Instance.GoogleApiKey);

            string smsTemplate = GetBuyerFeedbackSmsTemplate(trade.BuyerLanguageCode);

            smsTemplate = smsTemplate.Replace("{CustomerName}", trade.BuyerUserName);
            smsTemplate = smsTemplate.Replace("{SkuName}", sku.FullName);
            smsTemplate = smsTemplate.Replace("{Link}", shortUrl);

            SmsUtil.SendMessage(trade.BuyerPhoneNumber, smsTemplate, "mooketplace");
        }
示例#3
0
        static string GetBuyerTradeNotice(Trade trade, SkuView sku, string sellerName, string sellerPhone)
        {
            string smsTemplate = GetBuyerSmsNoticeTemplate(trade.BuyerLanguageCode);

            smsTemplate = smsTemplate.Replace("{TradeCode}", trade.TradeCode);
            smsTemplate = smsTemplate.Replace("{Quantity}", trade.Quantity.ToString());
            smsTemplate = smsTemplate.Replace("{SkuName}", sku.FullName);
            smsTemplate = smsTemplate.Replace("{Total}", trade.Total.ToString());
            smsTemplate = smsTemplate.Replace("{Currency}", trade.Currency);
            smsTemplate = smsTemplate.Replace("{SellerName}", sellerName);
            smsTemplate = smsTemplate.Replace("{SellerNumber}", sellerPhone);
            return(smsTemplate);
        }
示例#4
0
        static void SendSupportEmail(Trade trade, SkuView sku, string sellerName, string sellerPhone)
        {
            string templateBody = GetTemplateBody("~/templates/tradeNotice.txt", "en-US");

            templateBody = templateBody.Replace("{TradeCode}", trade.TradeCode);
            templateBody = templateBody.Replace("{Quantity}", trade.Quantity.ToString());
            templateBody = templateBody.Replace("{SkuName}", sku.FullName);
            templateBody = templateBody.Replace("{Total}", trade.Total.ToString());
            templateBody = templateBody.Replace("{Currency}", trade.Currency);
            templateBody = templateBody.Replace("{BuyerName}", trade.BuyerUserName);
            templateBody = templateBody.Replace("{BuyerPhone}", trade.BuyerPhoneNumber);
            templateBody = templateBody.Replace("{SellerName}", sellerName);
            templateBody = templateBody.Replace("{SellerPhone}", sellerPhone);

            MailMessage message = new MailMessage(WebApplication.Instance.SmtpSettings.Username, WebApplication.Instance.SupportEmail);

            message.Subject    = String.Format("Trade Notice {0}", trade.TradeCode);
            message.Body       = templateBody;
            message.IsBodyHtml = false;
            SmtpClient smtpClient = SmtpUtil.CreateSmtpClient();

            smtpClient.SendAsync(message, null);
        }