Exemplo n.º 1
0
        public async Task DeleteEmailsAsync(string to, string campaignId = null)
        {
            await _emailRepository.DeleteAsync(to, campaignId);

            await _log.WriteInfoAsync(nameof(DeleteEmailsAsync), $"Campaign: {campaignId}, To: {to}",
                                      "Emails deleted");
        }
Exemplo n.º 2
0
        public async Task <object> Delete(Guid contactId, Guid id)
        {
            _logger.LogInformation($"delete.email contact: {id} record: {id}");
            AssertValidIds(contactId, id);
            var resp = await _repository.DeleteAsync(contactId, id);

            _logger.LogInformation($"deleted.email contact: {id} record: {id} resp: {resp}");
            return(new
            {
                Message = "Deleted Email"
            });
        }
Exemplo n.º 3
0
        public async Task <bool> DeleteAsync(EmailMessage model)
        {
            var success = await _emailRepository.DeleteAsync(model.Id);

            if (success)
            {
                if (_logger.IsEnabled(LogLevel.Information))
                {
                    _logger.LogInformation("Deleted email '{0}' with id {1}",
                                           model.Subject, model.Id);
                }

                CancelTokens(model);
            }

            return(success);
        }
Exemplo n.º 4
0
        public async Task <IActionResult> DeleteEmail([FromForm] long Id)
        {
            try
            {
                if (Id <= 0)
                {
                    return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Id not found!"));
                }
                else
                {
                    var result = await _emailRepo.DeleteAsync(Id);

                    return(Ok(result));
                }
            }
            catch (Exception ex)
            {
                return(StatusCode((int)System.Net.HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Exemplo n.º 5
0
 public void DeleteAsync(int id)
 {
     _repository.DeleteAsync(id);
 }
Exemplo n.º 6
0
 public async Task DeleteAsync(Guid id)
 {
     await _emailRepository.DeleteAsync(id);
 }