Triggered email sent to Vendors

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Triggered email sent to Vendors

Post by draneb » Thu Aug 27, 2009 6:43 am

I started a drop shipping website and at first I only had one drop shipper so this template worked fine. But now I have three and if I get an order which contains multiple products from different vendors the vendors are telling me that they are receiving a packing slip for products they do not carry.

I am using this code for the template which I got from the forums. Logan had changed some things and posted this code. It's great, except I think the part that seperates products by Vendors was left out. Could someone add that code in and repost? :) Thank you.

Code: Select all

<html>
<head>
  <style type="text/css">
  .backgroundWrapper {background-color:#304FBA;margin:0px;padding:6px;}
  .contentWrapper{background:#FFF;}

  .emailHeader {width:100%}
  .emailHeader th {font-weight: bold;font-size: 12px;color: #fff;font-family: Verdana;background-color: #304FBA;text-align: center;text-decoration: none;padding: 5px;}
  .emailHeader td {font-weight: normal;font-size: 12px;color: #000;font-family: Verdana;background-color: #fff;text-align: left;text-decoration: none;padding: 3px;}
  .emailHeader td h2 {font-weight: bold;font-size: 18px;color: #000;font-family: Verdana;background-color: #fff;text-align: left;text-decoration: none;margin:0px;}

  .shipmentContainer {width:100%;border-top: 1px dashed #333;margin-top:10px}
  .shipmentContainer th {font-weight: bold;font-size: 12px;color: #fff;font-family: Verdana;background-color: #304FBA;text-align: center;text-decoration: none;padding: 5px;}
  .shipmentContainer td {font-weight: normal;font-size: 12px;color: #000;font-family: Verdana;background-color: #fff;text-align: left;text-decoration: none;padding: 3px;}
  .indent {padding-left:20px;}

  .itemsGrid {width:100%}
  .itemsGrid th {font-weight: bold;font-size: 12px;color: #fff;font-family: Verdana;background-color: #304FBA;text-align: center;text-decoration: none;padding: 5px;}
  .itemsGrid td {font-weight: normal;font-size: 12px;color: #000;font-family: Verdana;background-color: #fff;text-align: left;text-decoration: none;padding: 3px;}

  .emailFooter {width:100%;padding:10px 4px;}
  .footerText {color:#000;font-size:12px;font-family:Verdana;}
  </style>
</head>

<body>

##############################
## OPEN THE CONTAINER TABLES
##############################
<div class="backgroundWrapper">
  <div class="contentWrapper">

##############################
## DRAW THE EMAIL HEADER
##############################
    <table class="emailHeader">       <tr>
        <td align="right" valign="top" width="300px">
          <h2>Packing Slip</h2>
          <strong>Order Number</strong>: ${order.OrderNumber}<br />
          <strong>Order Date</strong>: ${order.OrderDate}
        </td>
        <td valign="top">
          <strong>${store.Name}</strong><br />
          <div class="indent">
            ${store.DefaultWarehouse.FormatAddress(true)}<br />
            Phone: ${store.DefaultWarehouse.Phone}
#if ($store.DefaultWarehouse.Email.Length > 0)
            <br />Email: <a href="mailto:${store.DefaultWarehouse.Email}?subject=Vendor_Notification_Order_${order.OrderNumber}">${store.DefaultWarehouse.Email}</a>
#end
          </div>
        </td>
      </tr>
    </table>

##############################
## OUTPUT NON-SHIPPABLE ITEMS
##############################
#foreach($orderItem in $VendorNonShippingItems)
#beforeall
    <table class="itemsGrid">
      <tr>
        <th colspan="3" style="text-align:left;">Non-Shipping Items</th>
      </tr>
      <tr>
        <th>SKU</th>
        <th>Description</th>
        <th>Quantity</th>
      </tr>
#each

      <tr>
        <td style="text-align: center;">
#if ($orderItem.OrderItemType == "Product")
          $orderItem.Sku
#else
          $orderItem.OrderItemType.ToString().ToUpperInvariant()
#end
        </td>
        <td>
          $orderItem.Name
#if ($orderItem.VariantName.Length > 0)
 ($orderItem.VariantName)
#end
#foreach($orderItemInput in $orderItem.Inputs)
#if ((!$orderItemInput.IsMerchantField) && $orderItemInput.InputValue.Length > 0)
          <br /><b>$orderItemInput.Name:</b> $orderItemInput.InputValue
#end
#end
        </td>
        <td style="text-align: center;">$orderItem.Quantity</td>
      </tr>
#afterall
    </table>
#end

##############################
## OPEN A TABLE FOR EACH SHIPMENT
##############################
#foreach( $shipment in $VendorShipments )
#each
    <table class="shipmentContainer">
      <tr>
        <td valign="top" width="300px">
          <strong>Ship to:</strong>
          <div class="indent">
            $shipment.FormatToAddress(true)<br />
            Phone: $shipment.ShipToPhone<br />
            E-mail: $order.BillToEmail
          </div>
        </td>
        <td valign="top">
          <strong>Ship from:</strong>
          <div class="indent">
            $shipment.Warehouse.Name<br />
            ${shipment.Warehouse.FormatAddress(true)}<br />
           </div>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <strong>Shipment Method:</strong> 
$shipment.ShipMethodName
#if ($shipment.ShipMessage.Length > 0)
          <br /><strong>Message:</strong> ${shipment.ShipMessage}
#end
        <td>
      </tr>
      <tr>
        <td colspan="2">

##############################
## OUTPUT ITEMS GRID FOR THIS SHIPMENT
##############################

#foreach($orderItem in $order.Items)
#beforeall
          <table class="itemsGrid">
            <tr>
              <th>SKU</th>
              <th>Description</th>
              <th>Quantity</th>
            </tr>
#each

#if ($orderItem.OrderShipmentId == $shipment.OrderShipmentId)
            <tr>
              <td style="text-align: center;">
#if ($orderItem.OrderItemType == "Product")
                $orderItem.Sku
#else
                $orderItem.OrderItemType.ToString().ToUpperInvariant()
#end
              </td>
              <td>
                $orderItem.Name
#if ($orderItem.VariantName.Length > 0)
 ($orderItem.VariantName)
#end
#foreach($orderItemInput in $orderItem.Inputs)
#if ((!$orderItemInput.IsMerchantField) && $orderItemInput.InputValue.Length > 0)
                <br /><b>$orderItemInput.Name:</b> $orderItemInput.InputValue
#end
#end
              <td style="text-align: center;">$orderItem.Quantity</td>
            </tr>
#end
#afterall
          </table>
#end

##############################
## CLOSE THE SHIPMENT TABLE
##############################
        </td>       </tr>
    </table>
#end

##############################
## DRAW THE EMAIL FOOTER
##############################
    <div class="emailFooter">
      <span class="footerText">If you have any questions please contact $store.Name at <a href="${store.StoreUrl}">${store.StoreUrl}</a>.<span>
    </div>

##############################
## CLOSE THE CONTAINER TABLES
##############################
  </div>
</div>
</body>
</html>
AC 7.0.3 build 13937

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Triggered email sent to Vendors

Post by ZLA » Thu Aug 27, 2009 7:47 am

See this post: viewtopic.php?f=42&t=8571

Note that AC 7.0.3 uses files for email templates but AC 7.0.2 stores them in the database.

Also note there are a number of limitations on vendor emails in Able Commerce; it's drop ship / vendor features lack some basics out of the box. You may want to review these posts in case any of these issues apply to your situation as well:
viewtopic.php?f=42&t=11123
viewtopic.php?f=42&t=12081
viewtopic.php?f=42&t=12085
viewtopic.php?f=42&t=12067

Hope that helps.

Post Reply