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.
gabe
September 14, 2020, 8:43pm
4
Would this be addressed by this pull request?
mautic:staging
← kuzmany:fix-token-url
opened 01:56PM - 21 May 19 UTC
joeyk
March 3, 2023, 10:17am
6
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.
joeyk
March 5, 2023, 8:17am
8
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?
joeyk
March 7, 2023, 6:50pm
10
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.
joeyk
March 8, 2023, 10:23am
12
I think there is another bug here you are facing.
I think this bug is affecting you:
mautic:5.x
← ts-navghane:fix-email-send-with-company-tokens
opened 08:32AM - 14 Nov 22 UTC
<!-- ## Which branch should I use for my PR?
Assuming that:
a = current ma… jor release
b = current minor release
c = future major release
* a.x for any features and enhancements (e.g. 5.x)
* a.b for any bug fixes (e.g. 4.4, 5.1)
* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
| Q | A
| -------------------------------------- | ---
| Bug fix? (use the a.b branch) | ✅
| New feature/enhancement? (use the a.x branch) | ❌
| Deprecations? | ❌
| BC breaks? (use the c.x branch) | ❌
| Automated tests included? | ✅
| Related user documentation PR URL | mautic/mautic-documentation#...
| Related developer documentation PR URL | mautic/developer-documentation#...
| Issue(s) addressed | Fixes #...
<!--
Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the "4.x" branch.
-->
#### Description:
<!--
Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
-->
#### Steps to test this PR:
<!--
This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
-->
1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs [here](https://contribute.mautic.org/contributing-to-mautic/tester))
2. Create company Test1 with address 1 as Test1
3. Create contact and assign company Test1
4. Create company Test2 with address 1 as Test2
5. Then assign company Test2 to contact as primary but let also Test1 as secondary company
6. Create email with tokens like below:
```
{contactfield=email}
{contactfield=companyname}
{contactfield=companyaddress1}
```
7. Send template email via campaign or segment email to the contact created above
8. Observe the company name and address in the email, it should be Test2
<!--
If you have any deprecations, list them here along with the new alternative.
If you have any backwards compatibility breaks, list them here.
-->
We merged this into M4, cause it was vital for various functions.