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