Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Girish Khadse 52 posts 132 karma points
    May 24, 2013 @ 07:18
    Girish Khadse
    0

    How to show image in confirmation mail

    Hi,

    Has anyone overridden EmailService to show image in the mail? I know I will have to use LinkedResource to attach image. But as I can see in the existing implementation that they have not created any HtmlView to construct mail body. Could anybody please tell how to implement email service to attach image?

  • Morten Skjoldager 440 posts 1499 karma points
    May 24, 2013 @ 09:36
    Morten Skjoldager
    100

    Hi Girish,

    You won't need to override anything. If you have setup the email profile and types under settings, which basically is refering a node in your umbraco content tree, all you'd have to do is insert an image in the macro of your order confirmation page. Just remember it has to be an absolute path e.g; http://yoursite.com/images/mybanner.jpg, as its an external link to your site. 

    Let me know if you are struggeling with anything else.

    Best regards

    Morten

  • Girish Khadse 52 posts 132 karma points
    May 24, 2013 @ 10:41
    Girish Khadse
    0

    Hi Morten,

    Thank you for the reply.

    I am trying the approach you suggested. I am using default profile and default type for order confirmation. I have done the necessary settings in profile. But dont know what is Email type is used for? Can you enlighten me about it?

    Regards,

    Girish.

     

  • Morten Skjoldager 440 posts 1499 karma points
    May 24, 2013 @ 10:53
    Morten Skjoldager
    0

    each profile will contain one of each type you add. So it's just a way of specifiying what kind of emails you have e.g orderconfirmation , cancel mail , product code mail , invoice mail etc. etc.

  • Girish Khadse 52 posts 132 karma points
    May 24, 2013 @ 14:12
    Girish Khadse
    0

    Finally..

    setting absolute path to an image solved my issue. Just want to know the correct way to get an absolute path :

    What I did is :

     

     var lib = new umbraco.MacroEngines.Library.RazorLibraryCore(null);
    var media = lib.MediaById(1279);
    var domainName = System.Configuration.ConfigurationManager.AppSettings["LunaHomeUrl"];
    string fullPath= domainName + media.NiceUrl;
    --- html code -- <img src="@fullpath"/>

     

    Is there any better way to do the task?

  • Morten Skjoldager 440 posts 1499 karma points
    May 27, 2013 @ 10:13
    Morten Skjoldager
    0

    Hi Girish,

    That looks like a good way to do it. It entirely depends upon your shops architecture. Instead of hardcoding an id you could also use mediatypes and alias to get it. I've done so in previous projects where we needed to get order confirmation texts and such. 

    However what we did with an image in the order confirmation page (showing the logo), was to just plain old hard code it. It is one of those examples where it might be ok to do so as a logo would rarely change. However if you might think that the image would change some time, i'd suggest using the media type and alias strategy. 

    Regards

    Morten

  • Girish Khadse 52 posts 132 karma points
    May 27, 2013 @ 11:39
    Girish Khadse
    0

    Hi Morten,

    I agree with you about media type and alias strategy. Right now I dont think that the logo will change. So will go with the hardcoded id for a time being. If in the future, there is a requirement for a logo to change. I will provide a media type and access it by using.

    Regards, 

    Girish.

Please Sign in or register to post replies

Write your reply to:

Draft