# Email : Tracking URL causes 500 error

**URL:** <https://forum.mautic.org/t/email-tracking-url-causes-500-error/24078>\
**Category:** Product Support\
**Created:** [May 12, 2022, 1:09pm UTC](https://forum.mautic.org/t/email-tracking-url-causes-500-error/24078 "2022-05-12T13:09:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericf](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericf/32/1669_2.png) [@ericf](https://forum.mautic.org/u/ericf)\
**Post date:** [May 12, 2022, 1:09pm UTC](https://forum.mautic.org/t/email-tracking-url-causes-500-error/24078/1 "2022-05-12T13:09:24Z")

</div>

**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** :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ad517ded44e96f76087267164467d9dc4e0a8272.png)  
The redirect URL is : [https://www2.adp-group.fr/asset/{formfield=ressource\_id}](https://www2.adp-group.fr/asset/%7Bformfield=ressource_id%7D) and **works properly**.  
There are 2 submit actions : send results to my email address (so I get notified) which works well :  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c33220ad2a4d053db152750840ee5a8845a97460.png)  
and send an email to the contact :  
OBJECT :  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/38c026fc48352bc0df06a5dab97aa1899dc124ea.png)  
BODY :  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a179a815e9b5b835804c082ab5870e3809f897c7.png)  
Email received seems fine, as the displayed text is fine :  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f1f9be585c217c7409ce36f859f7b9f20769e76c.png)  
But the “real” links are :  
[https://www2.adp-group.fr/r/7b0f18d3fb3a1a78fc18dcca7?ct=YTo1OntzOjY6InNvdXJjZSI7YToyOntpOjA7czo0OiJmb3JtIjtpOjE7aTo3MTt9czo1OiJlbWFpbCI7aToxMjM7czo0OiJzdGF0IjtzOjIyOiI2MjdjZmM2MjZhOWJkNDI4MDY3MjQ2IjtzOjQ6ImxlYWQiO3M6NjoiMTcwNDc2IjtzOjc6ImNoYW5uZWwiO2E6MTp7czo1OiJlbWFpbCI7aToxMjM7fX0%3D&](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 :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2eea41d0c57e7f876ed56f68b1b708551812b7f5.png)

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.

```auto
[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)"} []

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f492bae90d5d27d7b96ed05eba371703b90dccb9.png)

Steps I have tried to fix the problem:  
I went under Configuration \> Email settings to deactivate URL tracking :  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5ef1d0821467511e4297fe6e97c3e06e86be2a0d.png)  
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 !!! 🙏

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 12, 2022, 6:48pm UTC](https://forum.mautic.org/t/email-tracking-url-causes-500-error/24078/2 "2022-05-12T18:48:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![leoschuler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/leoschuler/32/4798_2.png) [@leoschuler](https://forum.mautic.org/u/leoschuler)\
**Post date:** [May 12, 2022, 7:21pm UTC](https://forum.mautic.org/t/email-tracking-url-causes-500-error/24078/3 "2022-05-12T19:21:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ireferpesa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ireferpesa/32/3081_2.png) [@ireferpesa](https://forum.mautic.org/u/ireferpesa)\
**Post date:** [May 30, 2022, 2:18pm UTC](https://forum.mautic.org/t/email-tracking-url-causes-500-error/24078/4 "2022-05-30T14:18:38Z")

</div>

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](https://crm.xxx.com/asset/ficha-rod)  
invalid url  
link 1 → [https://crm.xxx.com/asset/ficha-{contactfield=producto}?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9](https://crm.xxx.com/asset/ficha-%7Bcontactfield=producto%7D?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9)  
link 2 → [https://crm.xxx.com/asset/ficha?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9](https://crm.xxx.com/asset/ficha?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9)

 ![Captura de Pantalla 2022-05-30 a las 16.04.54](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ab3ab3c665d70f594c566dc2ebf99e96e9292ad9.png)  
 ![Captura de Pantalla 2022-05-30 a las 16.05.27](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cf0cc21ea8eff4fc70d1bf30f1273724d37c7fc3.png)
