You are here

protected function HtmlMailTestForm::getOptions in HTML Mail 8

Same name and namespace in other branches
  1. 8.3 src/Form/HtmlMailTestForm.php \Drupal\htmlmail\Form\HtmlMailTestForm::getOptions()

Returns a list with all mail plugins.

Return value

string[] List of mail plugin labels, keyed by ID.

1 call to HtmlMailTestForm::getOptions()
HtmlMailTestForm::buildForm in src/Form/HtmlMailTestForm.php
Form constructor.

File

src/Form/HtmlMailTestForm.php, line 136

Class

HtmlMailTestForm
Class HtmlMailTestForm.

Namespace

Drupal\htmlmail\Form

Code

protected function getOptions() {
  $list = [];

  // Append all MailPlugins.
  foreach ($this->mailManager
    ->getDefinitions() as $definition) {
    $list[$definition['id']] = $definition['label'];
  }
  if (empty($list)) {
    $list['htmlmail'] = 'HTMLMailSystem';
  }
  return $list;
}