You are here

public function MaillogController::delete in Maillog / Mail Developer 8

Delete a specific maillog entry.

Parameters

int $maillog_id: The maillog ID.

1 string reference to 'MaillogController::delete'
maillog.routing.yml in ./maillog.routing.yml
maillog.routing.yml

File

src/Controller/MaillogController.php, line 102

Class

MaillogController
Primary controler behind the Maillog module.

Namespace

Drupal\maillog\Controller

Code

public function delete($maillog_id) {
  $id = intval($maillog_id);
  $this->database
    ->query("DELETE FROM {maillog} WHERE id = :id", [
    ':id' => $id,
  ]);
  $this
    ->messenger()
    ->addStatus($this
    ->t('Mail with ID @id has been deleted!', [
    '@id' => $id,
  ]));
  return $this
    ->redirect('view.maillog_overview.page_1');
}