Trackable urls do not support tokens

Your software
My Mautic version is: 2.16.0
My PHP version is: 7.1

Your problem
My problem is: If the mautic configuration is set to track links, then mautic does not allow using tokens in links. We need this for transactional emails, where the link might include, say, an email verification token.

2 Likes

We have the same issue here and currently no real clue how to solve this.

Would this be addressed by this pull request?

This is still the case, so I’ve opened an issue on Github [Tokens in email URLs not replaced if email tracking is enabled · Issue #12047 · mautic/mautic · GitHub]

We are using this in production every day and it works:

https://{contactfield=companyurl}/portal/login.php

Joey

Yeah, we have similar, but if email link tracking is switched on, it stops working.

"Disable trackable urls " is set to "no " in configuration (/s/config/edit in the "Message Seetings " section of the "Email Settings ")

I’m presuming this because it’s running the tracking replace before running the token replace, meaning the tokens are obscured, so it doesn’t replace anything.

It does work for me.
Not stats, but the redirect itself works really well.

Very interesting, I’ve tested on more than one instance - may I ask what Mautic version you’re using?

I tested with 4.4.5 and 4.4.6

very odd, as i can’t get it to work even once - just for clarity, is this link inside an a tag like <a href="https://{contactfield=companyurl}/portal/login.php">link text here</a> or plain text? My tests are all inside tags per the GitHub post. Will try and test plain text. Perhaps it only breaks in html/tags.

I think there is another bug here you are facing.
I think this bug is affecting you:

We merged this into M4, cause it was vital for various functions.