<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

declare(strict_types = 1);

namespace Kufer\Mail\Sender\Settings\Recipient\Einrichtung;

use Kufer\Mail\Address\IEMailAddress;
use Kufer\Mail\Address\EMailAddress;


class EMailEinrichtungRecipientSettings implements IEMailEinrichtungRecipientSettings
{
  public function getEinrichtungRecipient(): array
  {
    return array($this->getEinrichtungBaseRecipient());
  }

  public function getEinrichtungBaseRecipient(): IEMailAddress
  {
    $allgSettings = \AllgSettingsAPI::getAllgSettings();
    $vhsname = $allgSettings->vhsname;
    if (defined('ISKUFERTOOLS') && ISKUFERTOOLS) {
      $vhsemail = \EmailOperations::getToolEmailAddressForVhs();
    } else {
      $vhsemail = \EmailOperations::getStandardEmail();
    }

    return new EMailAddress($vhsname ?? 'Einrichtung', $vhsemail);
  }

  public function getEinrichtungRecipientPositionNames(): array
  {
    return array('Einrichtung');
  }
}