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