Unable to publish Email fragment | Community
Skip to main content
KotiSyamala
Level 5
March 28, 2025
Solved

Unable to publish Email fragment

  • March 28, 2025
  • 1 reply
  • 677 views

We're attempting to pass a complex array of objects. Everything works fine in the preview, and we're able to send proofs successfully.

 

The object is defined at the content template level and utilized in a fragment to render the object details, which also works perfectly.

 

However, we're encountering an issue when trying to publish the email fragment. The error message indicates that the fragment is malformed.

Best answer by KotiSyamala

@kotisyamala 

 

Instead of defining the array in the email template, declare it in the fragment

 

{{#each profile.productsInCart as |p|}} {{p.price}} {{/each}}

 

Thanks,

David


@davidkangni This fragment is coming out of a complex loop from the content template, which is looped inside a lookup data from a dataset (which is not supported yet in fragments), which we can't access inside a fragment.

 

We are working with Adobe on this. Complex objects are not yet supported for access over fragments from content templates. Lookups in the horizon to be made available in future releases to support in fragments.

1 reply

Pradeep_Kumar_Srivastav
Community Advisor
Community Advisor
March 28, 2025

Hi @kotisyamala , are you using any contextual attribute in the fragment as it is not supported.

KotiSyamala
Level 5
March 30, 2025

Here is a similar example of what we are trying: products is an array of objects

defined in email template: 

{% let products = profile.productsInCart %}

 

utilized in fragment : 

 

{{#each products as |p|}} {{p.price}} {{/each}}

 

DavidKangni
Community Advisor
Community Advisor
March 31, 2025

@kotisyamala 

 

Instead of defining the array in the email template, declare it in the fragment

 

{{#each profile.productsInCart as |p|}} {{p.price}} {{/each}}

 

Thanks,

David

David Kangni