/** * Try to detect unique beacon hash * * @param Mzax_Bounce_Message $message * @return Ambigous <string, boolean>|unknown|boolean */ public function detectBeaconHash(Mzax_Bounce_Message $message) { $beacon = $message->header('x-campaign-ref'); if ($beacon) { return $beacon; } $content = $message->getContent(); if (preg_match(self::BOUNDARY_REGEX, $content, $matches)) { return $matches[1]; } if (preg_match(self::IMAGE_REGEX, $content, $matches)) { return $matches[1]; } return false; }