jdavidbakr / mail-tracker

Package for Laravel to inject tracking code into outgoing emails.
MIT License
567 stars 129 forks source link

Exclude HEAD checks from triggering the link clicked event #200

Closed bretto36 closed 1 year ago

bretto36 commented 1 year ago

I found that recently we are getting a lot of false clicks/reads because automatic spam protection and phishing protection are checking the urls in our emails as soon as they are sent.

This is causing a decent amount of load on the sent_emails_url_clicked table when we send out our burst of emails.

This change seeks to skip the event and just do the redirect, thus reducing false clicks and DB load.

The SPAM protection appears to call "HEAD" calls instead of "GET" as they aren't interested in the result, just that things seem to redirect somewhere good.

jdavidbakr commented 1 year ago

Interesting. Can you please add a test and I'll accept the PR.

jdavidbakr commented 1 year ago

Closing since there are no tests included. If you want to re-open it please include tests.