Symfony 4 Twig Set background image without attachement

I’m trying to set a background image in my template email, but without attachement.
I’ve tried to upload the image in the server, it works fine but to view the email it needs to click for downloading it.

I’ve tried this :

<div style="background-image: url({{asset('logo.jpg')}})">

and this :

<div style="background-image: url('{{ email.image('@img/VPO_header.jpg') }}')">

Thanks.

Source: Symfony4 Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *