Page 1 of 1

Pulling the Thumbnail Image into "Send To Friend"

Posted: Mon Jun 30, 2008 2:57 pm
by aaronfrankel
Can anyone tell me what I need to call the thumbnail image for the "Send product to friend" email template?

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Sun Jul 06, 2008 11:59 pm
by sacards.com
good one .. any idea ?

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Mon Jul 07, 2008 3:25 am
by m_plugables
you can try the following code by putting it in the Email template where you want to show the Thumbnail.

Code: Select all

<img src='${product.ThumbnailUrl}' border="0" />

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Mon Jul 07, 2008 10:42 am
by aaronfrankel
mazhar wrote:you can try the following code by putting it in the Email template where you want to show the Thumbnail.

Code: Select all

<img src='${product.ThumbnailUrl}' border="0" />
Close, but did not work for email. It called the URL. However, it was relative and had the ~. So I added the following

Code: Select all

<img src='${store.StoreUrl}${product.ThumbnailUrl}' border="0" />
But I could not get rid of the ~ which meant I got this.

Code: Select all

http://www.DOMAINNAMEHERE.com~/Assets/ProductImages/59523FO_t.gif
Any further ideas?

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Mon Jul 07, 2008 6:11 pm
by jmestep
I just ran across this in the googlebase feed sample code on the wiki- it takes the ~/ problem into consideration for those URLs

url = product.NavigateUrl;
if (url.StartsWith("~/"))
{
url = url.Substring(2);
}
url = storeUrl + url;

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Tue Jul 08, 2008 1:43 am
by m_plugables
Thanks Judy...

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Tue Jul 08, 2008 1:46 am
by sacards.com
thanks judy ... can this be used within the email template ?

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Tue Jul 08, 2008 3:15 am
by m_plugables
thanks judy ... can this be used within the email template ?
Use the following code in Email template

Code: Select all

#if ($Product.ThumbnailUrl.Substring(0,2) == "~/")
    $Store.StoreUrl+$Product.ThumbnailUrl.Substring(2);
    <img src='${Store.StoreUrl}${Product.ThumbnailUrl.Substring(2)}' border="0" />
#else
    <img src='${Store.StoreUrl}${Product.ThumbnailUrl}' border="0" />
#end

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Tue Jul 08, 2008 10:25 am
by aaronfrankel
mazhar wrote:
thanks judy ... can this be used within the email template ?
Use the following code in Email template

Code: Select all

#if ($Product.ThumbnailUrl.Substring(0,2) == "~/")
    $Store.StoreUrl+$Product.ThumbnailUrl.Substring(2);
    <img src='${Store.StoreUrl}${Product.ThumbnailUrl.Substring(2)}' border="0" />
#else
    <img src='${Store.StoreUrl}${Product.ThumbnailUrl}' border="0" />
#end
That did not work for me. However, after some poking (I don't know ASP) this did.

Code: Select all

#if ($product.ThumbnailUrl.Substring(0,2) == "~/")
    <a href="${store.StoreUrl}/Product.aspx?ProductId=${product.ProductId}"><img src='$store.StoreUrl/$product.ThumbnailUrl.Substring(2)' border="0" /></a>
#else
    <img src='${store.StoreUrl}${product.ThumbnailUrl}' border="0" />
#end
Also making these lower case seemed to make a difference.

Code: Select all

${product.
${store.

Here is my complete code for anyone who wants it. I really hated the email templates. They looked like they had not been updated in many versions.

Code: Select all

<html>
<head>
<style type="text/css">
body {
	margin-left:auto;
	margin-right:auto;
	text-align:center;
}
h1 {
	font-size: 16px;
}
TABLE.Email {
width: 650px;
padding: 5px;
margin: 0px;
border: 1px solid #CCCCCC;
}
TABLE.Email TH {
font-weight: bold;
font-size: 12px;
color: #ffffff;
font-family: Arial, Verdana, Sans-Serif;
font-style: strong;
background-color: #304FBA;
text-align: center;
text-decoration: none;
padding: 5px;
}
TABLE.Email TD {
font-weight: normal;
font-size: 12px;
color: #000000;
font-family: Arial, Verdana, Sans-Serif;
background-color: #ffffff;
text-align: left;
text-decoration: none;
padding: 3px;
}
.head {
	border-bottom: solid 2px #0066FF;
}
.message {
	background-color:#FFFFCC;
	border: dashed 1px #CCCCCC;
	margin-left: 15px;
	margin-right: 15px;
	padding: 10px;
}
</style>
</head>
<body>
<table border="0" align="center" cellspacing="0" class="Email">
  <tr>
    <td class="head"><img src="http://www.frankelcostume.com/App_Themes/FCCI_Theme/images/logo.gif" alt="Frankel's Costume"></td>
    <td class="head" style="text-align:right; color:#CCCCCC; font-size: 1.5em;">You Might Like  </td>
  </tr>
  <tr>
    <td colspan="2">
		<h1>Hello, </strong></h1>
	<p><strong>${fromName}</strong> found this at ${store.Name} and thought you might find it of interest.</p>
	<p><a href="${store.StoreUrl}/Product.aspx?ProductId=${product.ProductId}">$product.Name</a></p>

	<p>

#if ($product.ThumbnailUrl.Substring(0,2) == "~/")
    <a href="${store.StoreUrl}/Product.aspx?ProductId=${product.ProductId}"><img src='$store.StoreUrl/$product.ThumbnailUrl.Substring(2)' border="0" /></a>
#else
    <img src='${store.StoreUrl}${product.ThumbnailUrl}' border="0" />
#end
	</p>

	<p><hr></p>
	<p>${fromName} at ${fromEmail} requested that we send this e-mail.</p>
	<p><strong><a href="${store.StoreUrl}">$store.Name</a></strong><br />
	$store.DefaultWarehouse.FormatAddress(true)</p>
	</td>
  </tr>
</table>
</body>
</html>

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Tue Jul 08, 2008 12:19 pm
by aaronfrankel
Also, after a poking the order confirmation email code with a sharp stick for a couple of hours this morning, I have come up with code to pull the Icon images into the order confirmation email. May need some cleaning up as, again, I don't know what I am doing with ASP. However, after testing it works and the image is linked to the product's page on the web site. Yes, I also tested it with multiple items in the order and it worked just fine.

Code: Select all

				#if ($orderItem.product.IconUrl.Substring(0,2) == "~/")
					<a href="${store.StoreUrl}/Product.aspx?ProductId=${orderItem.ProductId}">
						<img src='$store.StoreUrl/$orderItem.product.IconUrl.Substring(2)' border="0" />
					</a>
				#else
					<p>Image Not Available</p>
				#end
The hardest part was figuring this bit out.

Code: Select all

$orderItem.product.
Hope this is useful to someone else as well.

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Tue Jul 08, 2008 3:19 pm
by jmestep
Yes, it is useful and thank you. It was on my list of things to do.

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Fri Jul 18, 2008 11:25 am
by aaronfrankel
Instead of the description line, can anyone tell me how to pull the "variant" that was chosen instead? IE small, medium, large, black, white, etc etc.

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Fri Aug 22, 2008 9:59 am
by gregglbk
I added this code to my template and it works to some email systems. It does not display the image in gmail anyone have any ideas? I've tried different things and it still does not work.

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Fri Aug 22, 2008 11:59 am
by jmestep
I tried it and it's actually a gmail setting. On the email I got, I clicked "display images below" or you can also check "always display images from xxxxx"

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Mon Oct 13, 2008 10:37 am
by Road Rider
This is exactly what I am looking for, however where in the "order confirmation template" code do I insert this?

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Mon Oct 13, 2008 1:03 pm
by Road Rider
Never mind I got it.

Thanks all.

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Wed Nov 12, 2008 10:09 am
by aaronfrankel
aaronfrankel wrote:Instead of the description line, can anyone tell me how to pull the "variant" that was chosen instead? IE small, medium, large, black, white, etc etc.
Did anyone ever figure this out?

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Wed Nov 12, 2008 1:04 pm
by mazhar
Instead of the description line, can anyone tell me how to pull the "variant" that was chosen instead? IE small, medium, large, black, white, etc etc.
I think it is possible if you send an Email manually. Here is a post about how to send an Email template manually.
viewtopic.php?f=42&t=8571
You can load a variant depending upon the option choices and then send the Email template manually by passing it the product variant information.

Re: Pulling the Thumbnail Image into "Send To Friend"

Posted: Thu Nov 13, 2008 5:55 pm
by aaronfrankel
mazhar wrote:
Instead of the description line, can anyone tell me how to pull the "variant" that was chosen instead? IE small, medium, large, black, white, etc etc.
I think it is possible if you send an Email manually. Here is a post about how to send an Email template manually.
viewtopic.php?f=42&t=8571
You can load a variant depending upon the option choices and then send the Email template manually by passing it the product variant information.
Looking for automation.