+ // This looks silly - calling the hook twice. This smells like an accident. Restoring old cache-based lookup.
+ // $returnUrl = CRM_Utils_System::externUrl('extern/url', "u=$id&qid=$queue_id");
+ $returnUrl = "{$urlCache[$mailing_id . $url]}&qid={$queue_id}";