Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Requirement

...

Implementation

Email Template

Give the template a name, subject, and format.

Create the html.  An example below is provided with heavy comments.

...

Code Block
themeDJango
languagehtml/xml
linenumberstruecollapsetrue
#* @vtlvariable name="formatHelper" type="com.bpsinfo.ultracart.catalog.tobjects.FormatHelper" *#
#* @vtlvariable name="group" type="com.bpsinfo.ultracart.catalog.tobjects.GroupImpl" *#
#* @vtlvariable name="customer" type="com.bpsinfo.ultracart.autoresponder.tobjects.Customer" *#
## You may ignore the comments above.  They're editor hints for Intellij, an amazing editor
 

<!DOCTYPE html>
<html>
<body>
Hey. Please take a minute and review each item in your recent purchase. Thanks!
<table>
 

## the enrollment order had better exist if this email is being called in a campaign.
  #set($order = $customer.getEnrollmentOrder())
  #foreach($orderItem in $order.items)
  ## notice that orderItem and item are different.  orderItem contains a skeleton item and order-specific information
  ## item retrieved from the $group object has the full array of item information, like the view url, etc.
  ## $group is a provided variable.  It's named 'group' because it's also used in the store catalogs for group pages (pages that display a group of items)
    #set($item = $group.getItem($orderItem.getItemId()))
    #set($reviewed = $customer.hasReviewedItem($item.getMerchantItemID()))
    <tr>
      <td>
        <a target="_blank" href="$item.getViewURL()">$item.getDescription()</a>
      </td>
      <td>

        #if($reviewed)
          Reviewed. Thank you!
        #else
          ## the url below is secure.ultracart.com.  just leave it like that.  The url will do a redirect if you're using a custom SSL.
          ## This should be the starting pointing for review links.
          <a target="_blank"
             href="https://secure.ultracart.com/cgi-bin/UCReviewItem?merchantId=${customer.getMerchantId()}&itemId=${orderItem.getItemId()}">Write
            Review</a>
        #end ##if-reviewed

      </td>
    </tr>
  #end ##foreach-item in order
 

</table>
*|OPT_OUT|*
</body>
</html>

...

For the campaign, use an enrollment trigger of 'Purchased Product'.  

Image RemovedImage Added

 

 

Campaign Steps

Save your campaign, and then scroll down to the steps.  You'll need four steps.  While the process appears linear (no branching), the Logic step does contain an _ENDCAMPAIGN_ result, which is essentially a branch in that it marks a recipient as finished at that step.

Image RemovedImage Added

The Start step is created for you.

...