/** * Check if mail should be send * send when * - optin is deaktivated OR * - optin is active AND hash is correct * * @param Mail $mail * @param string $hash * @return bool */ protected function isSendMailActive(Mail $mail, $hash) { return empty($this->settings['main']['optin']) || !empty($this->settings['main']['optin']) && OptinUtility::checkOptinHash($hash, $mail); }