Email Template Problem
Posted: Mon Feb 16, 2009 4:20 pm
I made a slight modification to the Vendor Notification email template. Here is my html code:
<table class="Email"> <tbody><tr> <td valign="top"><strong>$store.Name</strong><br /> <div style="padding-left: 30px;">$store.DefaultWarehouse.FormatAddress(true) <br />Phone: $store.DefaultWarehouse.Phone <br />Email: $store.DefaultWarehouse.Email</div></td> <td align="right"><h1>Packing Slip</h1> <strong>Order Number</strong>: $order.OrderId<br /> <strong>Order Date</strong>: ${order.OrderDate}</td> </tr> </tbody></table> <p>#foreach( $shipment in $VendorShipments ) #end</p><table class="Email"><tbody><tr> <td><strong>Ship To:</strong> <div style="padding-left: 30px;"><p>$shipment.FormatToAddress(true) <br />Phone: $shipment.ShipToPhone #if ($shipment.ShipMessage.Length > 0) <br /> <strong>Message:</strong> $shipment.ShipMessage #end</p><p> </p><p style="text-align: center;"><span style="color: rgb(255, 0, 0); "><strong>Shipment Method:</strong></span></p> <div style="padding-left: 30px; text-align: center;">$shipment.ShipMethodName</div></div></td> </tr> <tr> <td>#foreach( $orderItem in $VendorItems ) #if ($orderItem.OrderShipmentId == $shipment.OrderShipmentId) #end #end <table width="100%" border="2" align="center"> <tbody><tr> <th class="Email">SKU</th> <th class="Email">Product Name</th> <th class="Email">Options</th> <th class="Email">Quantity</th> </tr><tr> <td style="text-align: center;">$orderItem.Sku</td> <td>$orderItem.Name<br /><font size="2"><strong>$orderItem.LineMessage</strong></font></td> <td>$orderItem.VariantName</td> <td style="text-align: center;">$orderItem.Quantity</td> </tr></tbody></table></td> </tr> <tr> <td style="text-align: center;"><br /> Thank you for your order. If you have any questions, please contact $store.Name</td> </tr></tbody></table>
Now, when the email sends, all I see is this in the email:
Lexical error: NVelocity.Runtime.Parser.TokenMgrError: Lexical error at line 1, column 673. Encountered: "g" (103), after : "&" at NVelocity.Runtime.Parser.Parser.Directive() at NVelocity.Runtime.Parser.Parser.Statement() at NVelocity.Runtime.Parser.Parser.Process() at NVelocity.Runtime.Parser.Parser.Parse(TextReader reader, String templateName)
Also, am I correct that if a customer orders multiple products (say 3 for example) and all 3 are shipped from different warehouses and from different vendors, that 3 of these Vendor Notification emails should be triggered to send (1 to each of the 3 vendors)? I have the trigger for this email to send set for "Payment Captured." The email is triggered appropriately when the payment is captured, but I get the error message above in the email, and only one email is sent when I think multiple emails should be triggered in some cases.
Any help would be greatly appreciated!
Jay
<table class="Email"> <tbody><tr> <td valign="top"><strong>$store.Name</strong><br /> <div style="padding-left: 30px;">$store.DefaultWarehouse.FormatAddress(true) <br />Phone: $store.DefaultWarehouse.Phone <br />Email: $store.DefaultWarehouse.Email</div></td> <td align="right"><h1>Packing Slip</h1> <strong>Order Number</strong>: $order.OrderId<br /> <strong>Order Date</strong>: ${order.OrderDate}</td> </tr> </tbody></table> <p>#foreach( $shipment in $VendorShipments ) #end</p><table class="Email"><tbody><tr> <td><strong>Ship To:</strong> <div style="padding-left: 30px;"><p>$shipment.FormatToAddress(true) <br />Phone: $shipment.ShipToPhone #if ($shipment.ShipMessage.Length > 0) <br /> <strong>Message:</strong> $shipment.ShipMessage #end</p><p> </p><p style="text-align: center;"><span style="color: rgb(255, 0, 0); "><strong>Shipment Method:</strong></span></p> <div style="padding-left: 30px; text-align: center;">$shipment.ShipMethodName</div></div></td> </tr> <tr> <td>#foreach( $orderItem in $VendorItems ) #if ($orderItem.OrderShipmentId == $shipment.OrderShipmentId) #end #end <table width="100%" border="2" align="center"> <tbody><tr> <th class="Email">SKU</th> <th class="Email">Product Name</th> <th class="Email">Options</th> <th class="Email">Quantity</th> </tr><tr> <td style="text-align: center;">$orderItem.Sku</td> <td>$orderItem.Name<br /><font size="2"><strong>$orderItem.LineMessage</strong></font></td> <td>$orderItem.VariantName</td> <td style="text-align: center;">$orderItem.Quantity</td> </tr></tbody></table></td> </tr> <tr> <td style="text-align: center;"><br /> Thank you for your order. If you have any questions, please contact $store.Name</td> </tr></tbody></table>
Now, when the email sends, all I see is this in the email:
Lexical error: NVelocity.Runtime.Parser.TokenMgrError: Lexical error at line 1, column 673. Encountered: "g" (103), after : "&" at NVelocity.Runtime.Parser.Parser.Directive() at NVelocity.Runtime.Parser.Parser.Statement() at NVelocity.Runtime.Parser.Parser.Process() at NVelocity.Runtime.Parser.Parser.Parse(TextReader reader, String templateName)
Also, am I correct that if a customer orders multiple products (say 3 for example) and all 3 are shipped from different warehouses and from different vendors, that 3 of these Vendor Notification emails should be triggered to send (1 to each of the 3 vendors)? I have the trigger for this email to send set for "Payment Captured." The email is triggered appropriately when the payment is captured, but I get the error message above in the email, and only one email is sent when I think multiple emails should be triggered in some cases.
Any help would be greatly appreciated!
Jay