Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon 692 posts 1068 karma points
    Feb 26, 2015 @ 15:27
    Simon
    0

    Images in XSLT file email template not showing

    Hi,

    I need some help regarding showing images in XSLT file as an email template.

    I am using umbraco contour to send a contact form, and I am using xslt file as the email template. Now I want to show the company logo at the bottom. The image is just stored in the images folder, which means that I don't need to retrieve the image from Umbraco.Media etc...

    I am just using this:

        <img src="http://localhost/images/logo.jpg" alt="test"/>

    But the image link is not being rendered correctly in email. For example, in hotmail.com, the image becomes as follows in the email: 

    <img src="https://dub120.mail.live.com/Handlers/ImageProxy.mvc?bicild=&amp;canary=rvt%2fBInkOG6oEE35%2fE6dPKYiOx04VniGBnTH66PbFb4%3d0&amp;url=http%3a%2f%2flocalhost%2fimages%2flogo.jpg" alt="test">

    Does anybody knows how to render an image properly, please, using xslt file as an email template?

    Thank you very much, in advance.

    Kind Regards

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Feb 26, 2015 @ 16:01
    Dennis Aaen
    100

    Hi Simon,

    I think you issue is that you need to have the full url to the logo that you use in the email template. So try use this and see if it will work for you.

    <xsl:variable name="url" select="concat('http://',umbraco.library:RequestServerVariables('HTTP_HOST'))" />
    <img>
        <xsl:attribute name="src"> 
            <xsl:value-of select="$url"/>/images/logo.jpg
        </xsl:attribute>
        <xsl:attribute name="alt">Logo</xsl:attribute> 
    </img>

    Perhaps this could be done in a nicer way, but I think it will work for you.

    Hope this helps,

    /Dennis

  • Simon 692 posts 1068 karma points
    Feb 27, 2015 @ 11:33
    Simon
    0

    Thank you Dennis

    Cheers

Please Sign in or register to post replies

Write your reply to:

Draft