Mautic Community Forums

Email template - assets URL

Hi,

I’m trying to create own HTML email template in Mautic 1.4.1 and I have problems with the image’s URLs in final email.



I have created the basic structure:



config.php

  • html

    – email.html.php
  • images

    – logo.png



    In the template I’m using
Code:
<?php echo $view['assets']->getUrl('/templates/my_template/images/logo.png'); ?>
as image src.

The result is "/templates/my_template/images/logo.png" in the final e-mail, which doesn't work, of course. The workaround is to use the absolute URL as image path, but it ruins portability of the template.

What am I doing wrong?

I also wonder if it is possible to "pack" images into e-mail as attachements.

Thanks.

Hi,
I’m trying to create own HTML email template in Mautic 1.4.1 and I have problems with the image’s URLs in final email.

I have created the basic structure:

config.php

  • html
    – email.html.php
  • images
    – logo.png

In the template I’m using

<?php echo $view['assets']->getUrl('/templates/my_template/images/logo.png'); ?>

as image src.

The result is “/templates/my_template/images/logo.png” in the final e-mail, which doesn’t work, of course. The workaround is to use the absolute URL as image path, but it ruins portability of the template.

What am I doing wrong?

I also wonder if it is possible to “pack” images into e-mail as attachements.

Thanks.