You are here

protected function SubscriptionCancelForm::getDeletionMessage in Mailing List 8

Overrides ContentEntityDeleteForm::getDeletionMessage

File

src/Form/SubscriptionCancelForm.php, line 58

Class

SubscriptionCancelForm
Builds the form to cancel (delete) subscriptions.

Namespace

Drupal\mailing_list\Form

Code

protected function getDeletionMessage() {

  /** @var \Drupal\mailing_list\SubscriptionInterface $subscription */
  $subscription = $this
    ->getEntity();

  /** @var \Drupal\mailing_list\MailingListInterface $list */
  $list = $subscription
    ->getList();
  $message = $list
    ->getOnCancellationMessage();
  return $message ?: $this
    ->t('Your subscription %label to the %list mailing list has been cancelled.', [
    '%label' => $subscription
      ->label(),
    '%list' => $list
      ->label(),
  ]);
}