E-Mail Templates strips unwanted URL's / encoding issue

When i try to use URL links with the same domain in my email templates these gets stripped of and generates relative URL links.

for example I want to use an header image the same as my header Logo defined in branding module.
the link would be:
https://pbxdomain.com/static/static/pictures/branding-desktop-logo.png

but when this template gets e-mailed the image is not visible because the image link becomes:

/static/static/pictures/branding-desktop-logo.png

So it strips off the base URL…

Also another bug:

when i try to use this URL as a link:

in my case the ${SRVDOMAIN} gets weirdly converted…

for example SRVDOMAIN variable = pbx123.syzygy.eu

the final link it creates in the e-mail is:

https://pbx123.s%0A%20y%0A%20zygy.eu/gw/gw.php?ext=101&tenant=vitalpbx

It looks like an encoding issue…

Here is my vitalpbx version info: VitalPBX version 4.1.0-6

Fixed the issue. We removed all <span> and <br /> and replaced with <p> </p>

perhaps there was an unclosed html element in it which caused this weird encoding.