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"); }
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" }); }
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); }
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)); } }
public void DeleteAsync(int id) { _repository.DeleteAsync(id); }
public async Task DeleteAsync(Guid id) { await _emailRepository.DeleteAsync(id); }