Пример #1
0
        public async Task SellerUpdateAds(SellerUpdateAds sellerUpdateAds)
        {
            if (sellerUpdateAds.EmailRecipients != null)
            {
                var viewModel = new SellerUpdateAdsViewModel
                {
                    EmailContent = sellerUpdateAds.EmailContent
                };

                var attachmentFile = string.Empty;
                if (sellerUpdateAds.AdsContent != null)
                {
                    attachmentFile = ImageUrlHelper.PrepareAdsFile(sellerUpdateAds.AdsContent);
                }

                var body = await _razorViewToStringRenderer.RenderViewToStringAsync("/Views/Emails/Ads/SellerUpdateAds.cshtml", viewModel);
                await AddNotification(body, new EmailConf(sellerUpdateAds.EmailRecipients, Priority.High), sellerUpdateAds.Subject, attachmentFile);
            }
        }