Email : Tracking URL causes 500 error

Your software
My Mautic version is: 4.2.2
My PHP version is: 7.4.29

Your problem

I have a form with hidden fields (ressource_id + ressource_name), that are populated by a JS snippet.
In the source code, fields are correctly populated.
When submitting the form, the fields appear correctly in the form submission data :


The redirect URL is : https://www2.adp-group.fr/asset/{formfield=ressource_id} and works properly.
There are 2 submit actions : send results to my email address (so I get notified) which works well :
image
and send an email to the contact :
OBJECT :
image
BODY :
image
Email received seems fine, as the displayed text is fine :
image
But the “real” links are :
https://www2.adp-group.fr/r/7b0f18d3fb3a1a78fc18dcca7?ct=YTo1OntzOjY6InNvdXJjZSI7YToyOntpOjA7czo0OiJmb3JtIjtpOjE7aTo3MTt9czo1OiJlbWFpbCI7aToxMjM7czo0OiJzdGF0IjtzOjIyOiI2MjdjZmM2MjZhOWJkNDI4MDY3MjQ2IjtzOjQ6ImxlYWQiO3M6NjoiMTcwNDc2IjtzOjc6ImNoYW5uZWwiO2E6MTp7czo1OiJlbWFpbCI7aToxMjM7fX0%3D&
(288 char long)

When clicking on the links, I get following error, probably due to the misconstructed URL :

These errors are showing in the log:
I see only this error, not quite sure this is due to my issue as the time does NOT match the form submissions.

[2022-05-12 14:55:53] mautic.CRITICAL: Uncaught PHP Ex :pray:ception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getId() on null" at /home/ywop2408/adp-group.fr/mautic/app/bundles/AssetBundle/Model/AssetModel.php line 280 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function getId() on null at /home/ywop2408/adp-group.fr/mautic/app/bundles/AssetBundle/Model/AssetModel.php:280)"} []

Steps I have tried to fix the problem:
I went under Configuration > Email settings to deactivate URL tracking :
image
and it fixed the issue.
Meaning that it is caused by the URL tracking in the email settings

Note that I updated my Mautic instance a few days ago.
Don’t know whether it can be the cause or not;…

Many thanks for your support !!! :pray:

Your ressourse_id token is not being injected in the link.
How does the final link supposed to look like?
The ‘real link’ you mentioned up there also doesn’t work.

I believe you have to use the Form action “send form results” in order for the form data to be available in the e-mail as token, the form action “send email to contact”, will only have contact data available as token not the form submission data.
by choosing the action “send form results” you will see the option to send the email to contact and to select a email template, so all the features available in the “send email to contact” action is available here plus the formfield tokens.

The same thing happens to me. If I have the urls encryption activated, it does not replace the values of the form. I have mautic 4.1.2. I attach screenshots

valid url → https://crm.xxx.com/asset/ficha-rod
invalid url
link 1 → https://crm.xxx.com/asset/ficha-{contactfield=producto}?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9
link 2 → https://crm.xxx.com/asset/ficha?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9