Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed trackable link conversion that had other attributes with href #1429

Merged
merged 1 commit into from Apr 20, 2016

Conversation

alanhartless
Copy link
Contributor

Description

If the HTML of an email is copied out of another editor, data attributes may result in a link not getting converted to Mautic's trackables. For example, a link like

<a data-mce-href="http://mylink.com" href="http://mylink.com">Click</a>

Would result in data-mce-href's value being replaced with the click tracking URL but not the actual href. This PR fixes this by adjusting the preg_replace pattern and replacement to only match the true href attribute.

Testing

Create an list email with the above link and send it to the list. The emails received will be the raw URL and not the trackable. But if looking at the message source, you'll see data-mce-href was replaced with the trackable. Apply the PR and repeat. This time the true href tag will be converted and thus clicks tracked.

…n them (i.e. data-mce-href) that resulted in the actual href="" to not convert
@alanhartless alanhartless added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test labels Feb 10, 2016
@dongilbert
Copy link
Member

👍

@dongilbert dongilbert added pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-test PR's that are ready to test labels Feb 17, 2016
@escopecz
Copy link
Sponsor Member

Works for me 👍

@escopecz escopecz added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed pending-test-confirmation PR's that require one test before they can be merged labels Apr 20, 2016
@escopecz escopecz added this to the 1.4.0 milestone Apr 20, 2016
@dbhurley dbhurley merged commit 2455f0d into mautic:staging Apr 20, 2016
@alanhartless alanhartless deleted the trackable-link-href-fix branch June 15, 2016 07:35
@escopecz escopecz removed ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged labels Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants