Image link broken, no tracking
-
Been try to debug this for hours. First off the images were not being created in the track/e/o dir. Likely due to us being on WPEngine and them not allowing to write to the root. That said I could not find the code where the image is copied from the plugin to the dir.
I added this to line 114 of TrackEmail.php
public function get_track_code($email_id) { $structure = '/track/e/o/'.$email_id."/"; $upload = wp_upload_dir(); $upload_dir = $upload['basedir']; $upload_dir = $upload_dir . $structure; if (! is_dir($upload_dir)) { if(!mkdir( $upload_dir, 0777, true )){ echo 'Failed to create folders... '. $structure. '<br>'; } } $plugin_file = get_site_url().'/wp-content/plugins/email-tracker/images/tack-log.png'; $log_file = $upload_dir."/tack-log.png"; if (!copy($plugin_file, $log_file)) { echo "failed to copy $plugin_file to $log_file...<br>"; } return "<img />rw_url_email_open.$email_id."/tack-log.png?main_action=track-email.php&action=o&pk='.$email_id>"; }
This creates the file so it shows in the email but opens are still not tracking.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Image link broken, no tracking’ is closed to new replies.