jdavidbakr / mail-tracker

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

track-links problem #106

Closed ivang76 closed 4 years ago

ivang76 commented 4 years ago

Hi there, if I activate the track-links on a newsletter that contains an url like this:

https://somedomain.com/sites/default/files/storage/attachments/l'ideatorio/l'ideatorio-bando-2020.pdf

the email received by the recipients contains an incomplete and wrong link, it seems that has been cut after the ' and the result is this:

https://somedomain.com/sites/default/files/storage/attachments/l

This is an urgent problem, could you fix in some way or tell me where I can put a workaround please? thnx!

ivang76 commented 4 years ago

It seems that changing the regex in the injectLinkTracker function, removing the ' and rewriting in this way, could fix the problem: $html = preg_replace_callback( "/(<a[^>]*href=[\"])([^\"]*)/", [$this, 'inject_link_callback'], $html );

@jdavidbakr what do you think about? thank you so much for a your feedback

jdavidbakr commented 4 years ago

Feel free to submit a pull request.

ivang76 commented 4 years ago

ok @jdavidbakr done, in a temp new branch, but when I try to push I get an error due to access rights. Should I do something different?

jdavidbakr commented 4 years ago

You need to fork it into your own github account, and then from there submit a pull request.

ivang76 commented 4 years ago

ok done https://github.com/jdavidbakr/mail-tracker/pull/108 @jdavidbakr let me know, thanks!

jdavidbakr commented 4 years ago

Fixed version 4.0.6