Merge field loops are best explained with a few illustrations. In the example below, we'll imagine that a visitor to our NetCommunity website completed an event registration. In this transaction, our website visitor purchased tickets to two different events...the Golf Outing and the Awards Dinner. For the Golf Outing, the visitor purchased one foursome (four participants in this package) and two sponsor ticket packages (one participant per sponsor package) and for the Awards Dinner, she purchased one table (six seats) and four individual seats.

Let's assume that we'd like for our acknowledgement email to indicate all of the above relevant information. To illustrate how to accomplish this, we'll start wtih just a few basic merge fields and we'll see what the resulting email would look like. Then we'll modify the email step-by-step, seeing the resuling change to the email.

To begin, let's add the following merge fields to our email:



The green loop begin and end markers indicate where NetCommunity will 'loop over' the events for which our visitor registered and, within each event, the ticket pricing levels that she purchased. Recall that she purchased tickets in two separate events. In the Golf Outing, she purchased one (1) foursome and two (2) sponsor tickets and for the dinner, one (1) table and four (4) individual seats. Given that, here's how our merge fields would look in the acknowledgement email to the visitor:

4264

Not exactly what we're after. What we see here are the individual quantities of event participants at each pricing level (four in the foursome, two sponsors, six at the table for the dinner, and four individuals). Now let's insert a simple line break after the <Pricing Number of Participants> merge field:


This results in the following:

4
2
6
4


At least each quantity is shown on its own line now. Let's continue, adding some plain text to tell our site visitor what these numbers mean:



Here's how our acknowledgement email looks now:

Number of participants:  4
Number of participants:  2
Number of participants:  6
Number of participants:  4


Looking better. Continuing on, we can now add the name of each event using the <Event Item Name> merge field and also add some extra spaces before the pricing loop section begins on line two:



This creates a nice effect visually:

Golf Outing
     Number of participants: 4
     Number of participants: 2
Awards Dinner
     Number of participants: 6
     Number of participants: 4


We're nearly there. Let's make one final change, adding the <Pricing Description> merge field, an extra line break at the end of the Pricing Loop, and applying some simple text formatting to the merge fields themselves:



Finally we have what we are after:

Golf Outing
     Foursome - Number of participants: 4
     Sponsor - Number of participants: 2

Awards Dinner
     Table - Number of participants: 6
     Individual - Number of participants: 4