SES templates support the full Handlebars syntax. For example, nested attributes, lists, conditional statements.
The simplest approach is to integrate a browser-based Handlebars formatter.
More information here: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-advanced.html.