0

I have this code that includes the picture of a product.

<!--[if mso | IE]><td style=vertical-align:middle;width:150px><![endif]-->
<div class="mj-column-per-25 outlook-group-fix"style=font-size:0;text-align:center;direction:ltr;display:inline-block;vertical-align:middle;width:25%>
    <table border=0 cellpadding=0 cellspacing=0 role=presentation style=vertical-align:middle width=100%>
        <tr>
            <td style=font-size:0;padding:5px;word-break:break-word align=center>
                <table border=0 cellpadding=0 cellspacing=0 role=presentation style=border-collapse:collapse;border-spacing:0>
                    <tr>
                        <td style=width:100px>
                            <img height=auto src="%%=v(@imageURL)=%%" style=border:0;display:block;outline:0;text-decoration:none;height:auto;width:100%;font-size:13px width=100>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <!--[if mso | IE]></td><![endif]-->

The issue is when I do the preview the image is displayed but when I do a real sent it disappears, the @imageURL variable always include a valid image URL.

  • Why are you trying to use the Concat function? – zuzannamj Sep 16 '19 at 11:44
  • to be able to include ampscript inside the code (the value of @ImageUrl), is there a better way to do it? – fromero Sep 16 '19 at 11:47
5

Why not just use inline AMPscript to output the @ImageURL value? Removing the double-quotes to make the concat function work is likely the issue:

<!--[if mso | IE]>
<td style="vertical-align:middle;width:150px">
<![endif]-->
    <div class="mj-column-per-25 outlook-group-fix" style="font-size:0;text-align:center;direction:ltr;display:inline-block;vertical-align:middle;width:25%">
        <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:middle" width="100%">
            <tr>
                <td style="font-size:0;padding:5px;word-break:break-word" align="center">
                     <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0">
                        <tr>
                            <td style="width:100px">
                                <img src="%%=v(@imageURL)=%%" style="border:0;display:block;outline:0;text-decoration:none;height:auto;width:100%;font-size:13px" width="100">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
<!--[if mso | IE]>
</td>
<![endif]-->

Also appears that you have some missing td and tr tags. It might be helpful to re-indent everything to ensure it's structured as you intended.

Reference

| improve this answer | |
  • Thanks Adam, I already fixed the code but still same issue... – fromero Sep 16 '19 at 12:07
  • Please update your question with the fixed code. – Adam Spriggs Sep 16 '19 at 16:03
  • It is already updated – fromero Sep 17 '19 at 7:36
  • does the image show when you simply output <img height="auto" src="%%=v(@imageURL)=%%" style="border:0;display:block;outline:0;text-decoration:none;height:auto;width:100%;font-size:13px" width="100">? – Adam Spriggs Sep 17 '19 at 11:25
  • And why are you not using quotes around your tag attribute values? – Adam Spriggs Sep 17 '19 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.