- [Home page](https://www.brimit.com/)
- [Blog](https://www.brimit.com/blog)

# Sitecore Send Iterations: Complex Data Structures in Transactional Emails

[Tech Talks](https://www.brimit.com/blog?categories=Tech%20Talks) [DXP](https://www.brimit.com/blog?platforms=DXP)
[Igor Zharikov](https://www.brimit.com/blog/author?authors=Igor%20Zharikov) on April 17, 2025

![Sitecore Send](https://www.brimit.com/-/jssmedia/images/blog/sitecore-send-apis/sendlogo.png?h=400&iar=0&w=660&hash=1A34554FB4C322BA3D6ACC239404FCB1)

Sitecore Send keeps improving and adding new features to enhance the Send experience. Their latest addition extends Transactional Campaigns: now, [Iterations](https://doc.sitecore.com/send/en/developers/api-documentation/dynamic-templates-for-transactional-campaign.html) can be used in Transactional Campaigns.

#### Iterations

Initially, only a simple string key-value structure was allowed in the `Substitutions` body. Now, you can pass **complex data objects** in the [API payload](https://doc.sitecore.com/send/en/developers/api-documentation/manage-a-transactional-campaign.html):

```
{
    ...
    "Personalizations": [
        {
            "To": ...,
            "Substitutions": {
                "complexObject": {
                    "list": [
                        {
                            "name": "List Item 1",
                            "review": {
                                "rating": 5,
                                "amountOfReviews": 193
                            },
                            "tags": [
                                "sitecore",
                                "send",
                                "transactional"
                            ]
                        },
                        ...
                    ]
                }
            }
        }
    ]
}
```

And use the following syntax to iterate through complex data objects:

```
{{#each complexObject.list}}
{{this.name}} : (Rating: {{this.review.rating}})
<ul>
    {{#each this.tags}}
    <li>{{this}}</li>
    {{/each this.tags}}
</ul>
{{/each complexObject.list}}
```

**⚠️ Note:** It’s important to include the full path in the closing tag — `{{/each this.tags}}` — to avoid rendering issues. Omitting `this.tags` in the closing tag may result in unexpected behavior.

#### Example

To generate an email like this:

![Transactional Email example with iterations.](https://www.brimit.com/-/media/images/blog/sitecore-send/transactional-campaigns-iterations/final-email.png)

The Transactional Email design looks like this:

![Transactional Campaign with iterations campaign editor](https://www.brimit.com/-/media/images/blog/sitecore-send/transactional-campaigns-iterations/campaign-editor.png)

And the code for Iterations is inserted into the *HTML Item*:

![Html Iteration Section](https://www.brimit.com/-/media/images/blog/sitecore-send/transactional-campaigns-iterations/html-section.png)

As you can see, the iteration token can be combined with standard string token syntax.

The HTML code used for **Iteration**:

```
<div class="container">
    <div>
        {{#each content.articles}}
            <a href="{{this.href}}">
                <img src="{{this.image}}" alt="{{this.title}}" style="float: left;width: 50px;margin-right: 15px;border-radius: 50%;">
                <h2>{{this.title}}</h2>
            </a>
            <p style="margin-bottom: 10px">{{this.description}}</p>
            {{#each this.tags}}
                <span style="background-color: lightblue; padding: 2px 5px; margin-right: 5px;">{{this}}</span>
            {{/each this.tags}}
            <hr style="margin-bottom: 10px;"/>
        {{/each content.articles}}
    </div>
</div>
```

See the full code and example here: [Gist](https://gist.github.com/izharikov/6914a9daa42c161db321baf1f6e19cfc). Use this link to get the campaign JSON file (which can be imported) and to see the full request body.

#### Use in Code

Use the latest [SitecoreSend.SDK](https://www.nuget.org/packages/SitecoreSend.SDK/0.1.12) NuGet package (v0.1.12). Then, in your code:

```
var request = EmailRequestBuilder.Start(campaign)
    .AddPersonalization(new Personalization(testEmail, "Igor Zharikov")
    {
        Substitutions = new Dictionary<string, object>()
        {
            {"orderNumber", "123456"},
            {"paymentMethod", "PayTest"},
            {"total", "123.00 USD"},
            {"complex", new
            {
                items = new List<string>() {"item1", "item2"},
            }},
        },
    })
    ...
    .Build();

var result = await _send.Transactional.Send(request);
```

#### Conclusion

It’s great to see continuous updates and new features in Sitecore Send. The support for complex data structures in transactional emails opens the door to highly dynamic and personalized email experiences.

If you have any questions or suggestions, feel free to reach out to me.

###### More From Author

##### Extending Claude Code for Sitecore XP Development
September 14, 2026[Extending Claude Code for Sitecore XP Development](https://www.brimit.com/blog/sitecore-xp-claude-setup)

##### Sitecore 10.5 Release
August 7, 2026[Sitecore 10.5 Release](https://www.brimit.com/blog/sitecore-10-5-whats-new)

##### Sitecore Marketplace SDK Integration with Vercel AI SDK
February 25, 2026[Sitecore Marketplace SDK Integration with Vercel AI SDK](https://www.brimit.com/blog/sitecore-marketplace-sdl-integration-with-vercel-ai-sdk)

###### Author

![Igor Zharikov - Senior Sitecore Developer, Sitecore MVP](https://www.brimit.com/-/jssmedia/feature/blogs/authors/igor-zharikov-2.jpg?h=700&iar=0&w=700&hash=292A84E8CB3E5CE57CA743385CFB1464)

Igor Zharikov

Sitecore MVP / Senior Sitecore Developer
[Igor Zharikov](https://www.brimit.com/blog/author?authors=Igor%20Zharikov)

###### More By Categories

[#Events](https://www.brimit.com/blog?categories=#Events) [#How-to](https://www.brimit.com/blog?categories=#How-to) [#News](https://www.brimit.com/blog?categories=#News) [#Guides](https://www.brimit.com/blog?categories=#Guides)

###### More by Platform

[Data and AI](https://www.brimit.com/blog?platforms=Data%20and%20AI) [DXP](https://www.brimit.com/blog?platforms=DXP) [E-commerce](https://www.brimit.com/blog?platforms=E-commerce) [Internet of Things](https://www.brimit.com/blog?platforms=Internet%20of%20Things) [Sales and marketing automation](https://www.brimit.com/blog?platforms=Sales%20and%20marketing%20automation)

#### More on Sitecore

![How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects](https://www.brimit.com/-/jssmedia/project/brimit/blog/2024/vercel_cover-image.png)
#Guides #How-to DXP E-commerce

##### How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects

Optimize and accelerate the development and deployment of complex multisite Sitecore projects.

Alexei Vershalovich on July 17, 2024
[How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects](https://www.brimit.com/blog/how-vercel-will-help-you-save-effort-when-deploying-sophisticated-sitecore-projects)

![Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story](https://www.brimit.com/-/jssmedia/project/brimit/blog/2023/sitecore-mentoring---cover-image.png)
#How-to DXP

##### Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story

How to participate in the Sitecore Mentor program and help younger colleagues jump-start a career in Sitecore development.

Sergey Baranov on October 2, 2023
[Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story](https://www.brimit.com/blog/training-up-tomorrows-sitecore-mvps)

![Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)](https://www.brimit.com/-/jssmedia/project/brimit/blog/2022/headless/adobestock_456986731.jpg)
#How-to DXP E-commerce

##### Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)

Discover how a headless CMS can benefit organizations that use Sitecore.

Daniil Raschupkin, Palina Trokhautsava on September 15, 2022
[Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)](https://www.brimit.com/blog/going-headless-part-2-when-a-headless-cms-is-your-best-bet-if-you-have-sitecore)
