skyslasher / de.ergomation.wp-civi-mosaico

GNU Affero General Public License v3.0
7 stars 3 forks source link

CiviMail open tracking is broken by extension #3

Closed agileware-fj closed 3 years ago

agileware-fj commented 3 years ago

When sending an email with this plugin enabled, the tracking pixel image is replaced with a relative URL e.g. <img src="/civicrm/mailing/open" ...> which obviously will not work. Additionally the ?qid=... parameter is removed, so even if the URL was absolute, it would not work for tracking opens.

The system where this issue was discovered has clean URLs enabled for CiviCRM.

There is a related warning displayed during the send process:

PHP Warning: mime_content_type({DOCROOT}/wp-content/uploads/civicrm/mailing/open/): failed to open stream: No such file or directory in {DOCROOT}/wp-content/uploads/civicrm/ext/de.ergomation.wp-civi-mosaico/CRM/WpCiviMosaico/EmbedImagesSender.php on line 287

Code reference for warning

Ideally this should not process the automatically inserted CiviMail URLs at all.

skyslasher commented 3 years ago

What Version of CiviCRM are you using? The plugin is scanning for the tracking pixel and leaves it untouched, but it seems that the tracking URL changed from .../open.php to .../open/ so it is not recognized.

agileware-fj commented 3 years ago

This is using CiviCRM 5.33.2

skyslasher commented 3 years ago

I uploaded a fix today that should eleminate this issue. Can you please check?

agileware-fj commented 3 years ago

@skyslasher the fix works with clean URLs, thanks!

I did some additional testing with clean URL disabled and it wasn't working there. Was fairly simple to work around that, I'll submit a PR shortly.

skyslasher commented 3 years ago

Merged, please check the merged branch. If everything works we can close the issue

agileware-fj commented 3 years ago

Is all working, thanks.

Closing the issue.