lisa4va
10-28-2009, 05:16 PM
Hi Guys,
I am thankful to have found CodingForums.com. There seems to be a ton of useful information that I find myself needing on a more constant basis.I am trying to familiarize myself with XML but I am having a recurring problem and any advice is greatly appreciated.
My site currently uses a third party shipping software to automate our customer communications. I would like to customize our shipping notification email to include an HTML table with images linked to our social media profiles.
I have added text and it displays fine but when adding the table the images display as attachments rather than in the table across the bottom of the email.
Which leads me to my question, how do I insert a piece of HTML code into an XML package? <XSL:?????
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">
<xsl:import href="System\Common" />
<xsl:output method="html" encoding="utf-8" />
<sw:settings>
<sw:preview>
<sw:count>1</sw:count>
</sw:preview>
<sw:email>
<sw:store id="1">
<sw:account>0</sw:account>
</sw:store>
<sw:default>
<sw:includeInMenu>True</sw:includeInMenu>
<sw:subject>Your Order {//Order/Number} Has Shipped</sw:subject>
</sw:default>
</sw:email>
<sw:general>
<sw:context>auto</sw:context>
</sw:general>
</sw:settings>
<xsl:template match="/">
<html>
<head>
<title>Shipment Notification</title>
<style>
body, td, table, div { font: 10pt Arial;}
</style>
</head>
<body>
<xsl:variable name="order" select="//Order[1]" />
<xsl:variable name="address" select="$order/Address[@type='bill']" />
<xsl:value-of select="$address/FirstName" />,
<p>
Your order <xsl:value-of select="$order/Number" /> has shipped and the tracking information is below. Thank you for your business!
</p>
<p>
<xsl:if test="count($order//Shipment[IsProcessed = 'true' and (not(.//Voided) or .//Voided != 'true')]) = 0">
<i>(No shipments)</i>
</xsl:if>
<xsl:for-each select="$order//Shipment[IsProcessed = 'true' and (not(.//Voided) or .//Voided != 'true') ]">
Shipped on <b><xsl:value-of select="sw:ToShortDate(ShippedDate)" /></b>
using <b><xsl:value-of select="ServiceUsed" /></b>: <b><xsl:call-template name="outputTrackingLink" /></b>
<br />
</xsl:for-each>
<br>
<p><font face="Arial">Tracking information will be available online 24 hours after receipt of this e-mail.<br>
</br><br>
</br>Tracking numbers beginning with a 1 may be tracked at <a href="http://www.ups.com" target="_blank">www.ups.com</a>
<br>Tracking numbers beginning with a 9 may be tracked at
<a href="http://www.usps.com" target="_blank">www.usps.com</a></br>
<br>Tracking numbers beginning with a 0 may be tracked at <a href="http://www.fedex.com" target="_blank">www.fedex.com</a></br>
<br>
<br>
</br>
Remember,
all items are 100% guaranteed! When your order arrives, if you are
dissatisfied for any reason please e-mail us at <a href="mailto:questions@championsond.com" target="_blank">questions@championsond.com</a> or call us toll-free at 1-866-000-0000. We'll
be happy to replace your order or give you a full refund if necessary.
We value your business and want the opportunity to earn it again!
</br>
<br><br>
</br>Don't
forget to become a Fan on
<a href="http://www.facebook.com/pages/Champions-On-D/64754010889?ref=ts">Facebook</a>
for a chance to win every Friday. and check out our blog,
<a href="http://www.championblog.com">www.championblog.com</a> for
product information and promos!</br>
<br><br>
</br>Thank you for your business!<br>
</br></br> Customer Support
<br><a href="http://www.championsond.com">www.championsond.com</a></br>
<br>1-866-000-0000</br>
</font>
</p>
</br>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
How do I insert the following code to display across the bottom rather than as attachments? And is there a "universal" way of adding simple code to XML?
<table width="557" align="center" cellpadding="0">
<tr>
<td width="195"><div align="center"><a href="http://www.facebook.com/home.php?#/pages/Champions-On-D/64754010889"><img src="http://www.championsond.com/skins/Skin_1/images/logos/fb.jpg" width="167" height="53" border="0"></a></div></td>
<td width="180"><div align="center"><a href="http://www.championblog.com"><img src="http://www.championsond.com/skins/Skin_1/images/social_blog.jpg" width="170" height="70" border="0"></a></div></td>
<td width="190"><div align="center"><a href="http://www.twitter.com/ChOnD"><img src="http://www.championsond.com/skins/Skin_1/images/twitter.jpg" width="153" height="36" border="0"></a></div></td>
</tr>
</table>
Thanks for any help!
Lisa4va
I am thankful to have found CodingForums.com. There seems to be a ton of useful information that I find myself needing on a more constant basis.I am trying to familiarize myself with XML but I am having a recurring problem and any advice is greatly appreciated.
My site currently uses a third party shipping software to automate our customer communications. I would like to customize our shipping notification email to include an HTML table with images linked to our social media profiles.
I have added text and it displays fine but when adding the table the images display as attachments rather than in the table across the bottom of the email.
Which leads me to my question, how do I insert a piece of HTML code into an XML package? <XSL:?????
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">
<xsl:import href="System\Common" />
<xsl:output method="html" encoding="utf-8" />
<sw:settings>
<sw:preview>
<sw:count>1</sw:count>
</sw:preview>
<sw:email>
<sw:store id="1">
<sw:account>0</sw:account>
</sw:store>
<sw:default>
<sw:includeInMenu>True</sw:includeInMenu>
<sw:subject>Your Order {//Order/Number} Has Shipped</sw:subject>
</sw:default>
</sw:email>
<sw:general>
<sw:context>auto</sw:context>
</sw:general>
</sw:settings>
<xsl:template match="/">
<html>
<head>
<title>Shipment Notification</title>
<style>
body, td, table, div { font: 10pt Arial;}
</style>
</head>
<body>
<xsl:variable name="order" select="//Order[1]" />
<xsl:variable name="address" select="$order/Address[@type='bill']" />
<xsl:value-of select="$address/FirstName" />,
<p>
Your order <xsl:value-of select="$order/Number" /> has shipped and the tracking information is below. Thank you for your business!
</p>
<p>
<xsl:if test="count($order//Shipment[IsProcessed = 'true' and (not(.//Voided) or .//Voided != 'true')]) = 0">
<i>(No shipments)</i>
</xsl:if>
<xsl:for-each select="$order//Shipment[IsProcessed = 'true' and (not(.//Voided) or .//Voided != 'true') ]">
Shipped on <b><xsl:value-of select="sw:ToShortDate(ShippedDate)" /></b>
using <b><xsl:value-of select="ServiceUsed" /></b>: <b><xsl:call-template name="outputTrackingLink" /></b>
<br />
</xsl:for-each>
<br>
<p><font face="Arial">Tracking information will be available online 24 hours after receipt of this e-mail.<br>
</br><br>
</br>Tracking numbers beginning with a 1 may be tracked at <a href="http://www.ups.com" target="_blank">www.ups.com</a>
<br>Tracking numbers beginning with a 9 may be tracked at
<a href="http://www.usps.com" target="_blank">www.usps.com</a></br>
<br>Tracking numbers beginning with a 0 may be tracked at <a href="http://www.fedex.com" target="_blank">www.fedex.com</a></br>
<br>
<br>
</br>
Remember,
all items are 100% guaranteed! When your order arrives, if you are
dissatisfied for any reason please e-mail us at <a href="mailto:questions@championsond.com" target="_blank">questions@championsond.com</a> or call us toll-free at 1-866-000-0000. We'll
be happy to replace your order or give you a full refund if necessary.
We value your business and want the opportunity to earn it again!
</br>
<br><br>
</br>Don't
forget to become a Fan on
<a href="http://www.facebook.com/pages/Champions-On-D/64754010889?ref=ts">Facebook</a>
for a chance to win every Friday. and check out our blog,
<a href="http://www.championblog.com">www.championblog.com</a> for
product information and promos!</br>
<br><br>
</br>Thank you for your business!<br>
</br></br> Customer Support
<br><a href="http://www.championsond.com">www.championsond.com</a></br>
<br>1-866-000-0000</br>
</font>
</p>
</br>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
How do I insert the following code to display across the bottom rather than as attachments? And is there a "universal" way of adding simple code to XML?
<table width="557" align="center" cellpadding="0">
<tr>
<td width="195"><div align="center"><a href="http://www.facebook.com/home.php?#/pages/Champions-On-D/64754010889"><img src="http://www.championsond.com/skins/Skin_1/images/logos/fb.jpg" width="167" height="53" border="0"></a></div></td>
<td width="180"><div align="center"><a href="http://www.championblog.com"><img src="http://www.championsond.com/skins/Skin_1/images/social_blog.jpg" width="170" height="70" border="0"></a></div></td>
<td width="190"><div align="center"><a href="http://www.twitter.com/ChOnD"><img src="http://www.championsond.com/skins/Skin_1/images/twitter.jpg" width="153" height="36" border="0"></a></div></td>
</tr>
</table>
Thanks for any help!
Lisa4va