Image in Firebase app invite email HTML content

1.1k views Asked by At

I am trying to add background image to a in email HTML content for a Firebase app invite but when I preview the email ,when shown a Activity to select from Google Contacts, the image is not loading in the preview and also email is being received by the recipients but without image. But when I use a free testing service like putsmail to send test HTML emails, then it works all fine, i.e. recipients' email has the required image.

This is my HTML string:

<string name="invitation_email_html_content">
<![CDATA[
<html>
   <body>
      <table background="https://static.pexels.com/photos/279734/pexels-photo-279734.jpeg" width="100%" height="400">
      <tr>
         <td>
            <div>
               <a href="#" style="color:#fff;width:163px;padding-top:10px;padding-bottom:10px;padding-right:0px;padding-left:0px;text-decoration:none;font-size:1.3em;margin-top:15px;margin-bottom:15px;margin-right:15px;margin-left:0;background-color:#ef4437;background-image:none;background-repeat:repeat;border-style:solid;border-width:1px;border-color:#ef4437;" >
               Donwload apps
               </a>
               <a href="#" style="color:#fff;width:163px;padding-top:10px;padding-bottom:10px;padding-right:0px;padding-left:0px;text-decoration:none;font-size:1.3em;margin-top:15px;margin-bottom:15px;margin-right:0;margin-left:0;background-image:none;background-repeat:repeat;border-width:1px;border-style:solid;border-color:#fff;" >
               Visit website
               </a>
            </div>
</body>
</html>]]>
1

There are 1 answers

0
Rishab Jaiswal On

SOLVED: different email clients(gmail,etc.) handle email CSS differently. Here is a link from Campaignmontor that tells what email clients support what CSS properties. Guide to email CSS

So, instead of using background property I used tag to display images in email HTML.

This above shared guide was really helpful in implementing email HTML.