From a88b6217583f9b0fa406a5b66364a37e47c4f444 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 4 Sep 2020 16:41:31 +1000 Subject: [PATCH] Add in normal url routes for tracked opens and tracking urls to the mend urls function and also make use of the normal routes when quering the target civi --- de.systopia.civiproxy/CRM/Civiproxy/Mailer.php | 2 ++ proxy/config.dist.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/de.systopia.civiproxy/CRM/Civiproxy/Mailer.php b/de.systopia.civiproxy/CRM/Civiproxy/Mailer.php index bdff057c..6c373797 100644 --- a/de.systopia.civiproxy/CRM/Civiproxy/Mailer.php +++ b/de.systopia.civiproxy/CRM/Civiproxy/Mailer.php @@ -53,7 +53,9 @@ static function mendURLs(&$value) { $proxy_base = CRM_Core_BAO_Setting::getItem('CiviProxy Settings', 'proxy_url'); // General external functions + $value = preg_replace("#{$system_base}civicrm/mailing/url#i", $proxy_base.'/url.php', $value); $value = preg_replace("#{$system_base}sites/all/modules/civicrm/extern/url.php#i", $proxy_base.'/url.php', $value); + $value = preg_replace("#{$system_base}civicrm/mailing/open#i", $proxy_base.'/open.php', $value); $value = preg_replace("#{$system_base}sites/all/modules/civicrm/extern/open.php#i", $proxy_base.'/open.php', $value); $value = preg_replace("#{$system_base}sites/default/files/civicrm/persist/#i", $proxy_base.'/file.php?id=', $value); $value = preg_replace("#{$system_base}civicrm/mosaico/img\?src=#i", $proxy_base.'/mosaico.php?id=', $value); diff --git a/proxy/config.dist.php b/proxy/config.dist.php index 59510bbe..9572a03d 100644 --- a/proxy/config.dist.php +++ b/proxy/config.dist.php @@ -33,8 +33,8 @@ // default paths, override if you want. Set to NULL to disable $target_rest = $target_civicrm . '/sites/all/modules/civicrm/extern/rest.php'; -$target_url = $target_civicrm . '/sites/all/modules/civicrm/extern/url.php'; -$target_open = $target_civicrm . '/sites/all/modules/civicrm/extern/open.php'; +$target_url = $target_civicrm . '/civicrm/mailing/url'; +$target_open = $target_civicrm . '/civicrm/mailing/open'; $target_file = $target_civicrm . '/sites/default/files/civicrm/persist/'; $target_mosaico = NULL; // (disabled by default): $target_civicrm . '/civicrm/mosaico/img?src='; $target_mail_view = $target_civicrm . '/civicrm/mailing/view'; @@ -155,4 +155,4 @@ "parameter_sanitation" => [], ] ] -]; \ No newline at end of file +];