public bool Subscribe(NewsletterDto model)
 {
     _newsletterRepository.Create(new Models.Casino.Entities.Newsletter
     {
         CreatedDate = DateTime.UtcNow,
         Email       = model.Email
     });
     return(true);
 }
Example #2
0
        public async Task <IActionResult> Send(Newsletter newsletter)
        {
            newsletter.SentAt = DateTime.UtcNow;
            await _newsletterRepository.Create(newsletter);

            var _ = _newsletterService.SendNewsletter(newsletter, HttpContext.Request.Scheme + "://" + HttpContext.Request.Host,
                                                      await _newsletterSubscriptionRepository.GetAll().ToListAsync(), await _caseRepository.GetLatest(),
                                                      await _newsItemRepository.GetLatest(), await _downloadRepository.GetLatest());

            return(View());
        }
        public async Task AddNewsletter(string email)
        {
            if (_repo
                .FindBy(e => e.Email.Equals(email))
                .FirstOrDefault() == null)
            {
                await _repo.Create(new Models.Newsletter()
                {
                    Email   = email,
                    AddedOn = DateTime.Now
                });

                await _unitOfWork.Commit();
            }
        }