3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Indicate that a CiviMail message has been opened
21 * General Usage: civicrm/mailing/open?qid={event_queue_id}
23 * NOTE: The parameter name has changed slightly from 'extern/open.php?q={event_queue_id}`.
25 class CRM_Mailing_Page_Open
extends CRM_Core_Page
{
28 * Mark the mailing as opened
30 * @throws \CRM_Core_Exception
32 public function run() {
33 $queue_id = CRM_Utils_Request
::retrieveValue('qid', 'Positive', NULL, FALSE, 'GET');
35 // Deprecated: "?q=" is problematic in Drupal integrations, but we'll accept if igiven
36 $queue_id = CRM_Utils_Request
::retrieveValue('q', 'Positive', NULL, FALSE, 'GET');;
39 echo "Missing input parameters\n";
43 CRM_Mailing_Event_BAO_Opened
::open($queue_id);
45 $filename = Civi
::paths()->getPath('[civicrm.root]/i/tracker.gif');
47 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
48 header('Content-Description: File Transfer');
49 header('Content-type: image/gif');
50 header('Content-Length: ' . filesize($filename));
51 header('Content-Disposition: inline; filename=tracker.gif');
55 CRM_Utils_System
::civiExit();