HomeHome Product Discus... Product Discus...RazorCartRazorCartProduct images in email templatesProduct images in email templates
Previous
 
Next
New Post
11/14/2018 4:20 PM
 
Is there a way to display product images in email templates?

Yes, but not using the [ORDERDETAIL] token you need to write some razor code for the detail section as follows:

@inherits System.Web.Mvc.WebViewPage<RazorCart.Service.Data.ModelDataContext.EmailTemplateModel>
<div style="width: 100%;">
    <table border="0" cellpadding="0" cellspacing="0" style="width:100%; border-collapse: collapse;">
        <thead>
            <tr>
                <th rowspan="2" style="text-align: left; vertical-align: top; width: 18%;">ITEM NO</th>
                <th rowspan="2" style="text-align: left; vertical-align: top; width: 28%;">DESCRIPTION</th>
                 
            </tr>
            <tr style="border-bottom: 1px solid;">
                <th style="text-align: center; vertical-align: top;">
                    Sku
                </th>
                <th style="text-align: center; vertical-align: top;">
                    Product Name
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.Order.OrderDetails)
            {
                <tr style="border-bottom: 1px solid;">
                    <td style="text-align: left; vertical-align: top;">
                        <img src="http://localhost@(item.ImageName)" />
                        @(item.ProductSKU)
                    </td>
                    <td style="text-align: left; vertical-align: top;">
                        @(item.ProductName)<br />
                        
                    </td
                </tr>
            }
        </tbody>
    </table>
</div>

Also, razor scripting in email templates was added in RazorCart v1.56 

At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
Previous
 
Next
HomeHome Product Discus... Product Discus...RazorCartRazorCartProduct images in email templatesProduct images in email templates