voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 504 forks source link

How I will set Background Image property for outlook client. #463

Closed sibbu2005 closed 6 years ago

sibbu2005 commented 6 years ago

Outlook background Image setting . How I will put @[backgroundImage.src] in outlook for background Image as an editable attribute. `<!--[if (gte mso 9)|(IE)]>

` Here is my working code is, where I am changing the background Image. `
` @bago regards -dhananjay
bago commented 6 years ago

I don't understand what's the question / bug... can you explain?

sibbu2005 commented 6 years ago

Hi @bago, I have added background image attribute in a block. It is working properly on web with all the clients. But it is not working on outlook desktop application. How I will fix it? Code I have given here is working perfectly on web. <div class="bg-image" class="bg-image" style="background-image: url(../../tempmodules/header-menu-pict-5.jpg); -ko-background-image: url(@[backgroundImage.src]); background-size: cover;">

How I will add a outlook VML tag that I can display the background image on desktop outlook? I can also change the URL of background Image,so how I will set background image dynamically.

The code required for outlook desktop to display background image is : <!--[if (gte mso 9)|(IE)]> <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:100%;"> <v:fill type="frame" src="https://www.psd2newsletters.com/templates/petras/img/header-menu-pict-5.jpg" color="#333333"/> <v:textbox inset="0,0,0,0"> <![endif]-->

Regards -d

bago commented 6 years ago

I still can't understand your question.. You tell me that you know the code to make it work, but you use a different code and that with the different code it doesn't work.....

Is there some markup that you put in the master template that mosaico is not handling correctly? What's the markup? What's the expected output and the real output?

sibbu2005 commented 6 years ago

Ok @bago , Let me explain once more

ISSUE - BACKGROUND IMAGE INVISIBLE in OUTLOOK 2007/2013

(1)- I have to change this background image just like we change background color. (2)- I am able to do this , but that is only working on web not on outlook 2007 or outlook 2013/16 etc.

(3)- for web I am using DIV tag and can change background image, code to display background image is <div class="bg-image" class="bg-image" style="background-image: url(../../tempmodules/header-menu-pict-5.jpg); -ko-background-image: url(@[backgroundImage.src]); background-size: cover;"> MY STUFFS </div>

(4)- as per guide lines for Outlook 2007 markup to display background image is:

<!--[if (gte mso 9)|(IE)]> <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:100%;"> <v:fill type="frame" src="https://www.psd2newsletters.com/templates/petras/img/header-menu-pict-5.jpg" color="#333333"/> <v:textbox inset="0,0,0,0"> <![endif]-->

(5)- as I am using style attribute in DIV tag like: style="background-image: url(../../tempmodules/header-menu-pict-5.jpg); -ko-background-image: url(@[backgroundImage.src]); background-size: cover;

(6)- How I will do the same for markup used for outlook 2007

as I am using -ko-background-image:url(@[backgroundImage.src]) for div in style tag , what should I use in the markup mentioned in point (4).

bago commented 6 years ago

Did you try simply using the outlook markup and adding a

style="-ko-attr-src: @[backgroundImage.src]"

to the <v:fill> element?

sibbu2005 commented 6 years ago

yes I tried, but not working, I reviewed my code many times.

bago commented 6 years ago

It is hard to help you.. What do you mean with "not working" ? Do you get a different output than expected? Did mosaico raise an exception? Please provide the minimal template to show the issue, the results, the expected result.

sibbu2005 commented 6 years ago

Thankyou very much @bago , Solved That was the mosaico exception related to Default value. -ko-attr-src woked, issued with another BG attributes, But my core problem is solved. BG image is visible now. After organizing I will share my code, This may help many people here.