URLs in segment email are not using the site_url

Hi, let me explain:

Your problem:
You installed your Mautic on an internal domain, that is not accessable from the internet.
→ This resulted in using a website tracking domain not accessible from the internet.
→ This also resulted in using a domain in each email for the tracking pixel + links, that is not accessable from the internet.

You are writing:

When we send emails as a test, the URLs are substituted correctly with the site_url (external hostname).

You substituted it manually. That is overwritten by Mautic when the real email is sent out. (It is called click tracking.) Also your tracking pixel will use the same (secret) domain.

Solutions
There are 3 solutions in my opinion, and you not gonna like them.

  1. Re-install your Mautic to the domain, that is available over the internet. You can’t track if you are not available. Use your internal domain as an alias, this way Mautic is also available from inside.

  2. Change your domain settings in Mautic (and replace all domains with mysql) in your database. Use your internal domain as an alias, this way Mautic is also available from inside.

  3. Create a plugin, that allows you tu use a tracking domain, that is separate from your Mautic install domain.

Important
In order to be the proper Tracking Overlord and ensure proper site tracking you want to store first party cookies on your visitors computer. If you are not using a subdomain of the domain your are tracking (for multi-domain tracking see Autoize’s solution: How to serve first party cookies with Mautic - one instance, several domains)

Glossary
Tracking domain = the domain where you installed your Mautic.
Install domain = in case of Mautic it’s the same as tracking domain, but in general the domain you install Mautic on.
Mautic First party cookie = Mautic is using a subdomain of the domain you are tracking.
More: