Example #1
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");
        }
Example #2
0
        static string ConvertToSmsText(string htmlBody, string href, string lang)
        {
            string pattern = @"<.*?>";

            string plainText = Regex.Replace(htmlBody, pattern, "");

            var googleApiKey = WebConfigurationManager.AppSettings["GoogleApiKey"];

            string shortLink = Google.GetShortUrl(href, googleApiKey);

            string footer = String.Format(Environment.NewLine + "Go to Mooketplace to view {0}", shortLink);

            if (lang == "zh-TW")
            {
                footer = String.Format(Environment.NewLine + "请登錄Mooketplace查看 {0}", shortLink);
            }

            return(plainText + footer);
        }