RE: Dynamic email content from related record (1:N)
Hi Tiina,
A correct code shall below:
{{#each contact.contact_opportunity.opportunityid}}
{{#if (eq this.statecode 1)}}
<li>Won: {{this.name}}</li>
{{else if (eq this.statecode 2)}}
<li>Lost: {{this.name}}</li>
{{/if}}
{{/each}}
Actually, Won/Lost /Open status is represented with int num and status logical name is statecode.
Now i get trouble in setting a 1:N relationship between contact and opportunity, I found existed relationships in customization for contact entity and opportunity as related entity,
however these existed relationship can't be proper statement for for-each loop.
Once a correct relationship could be set, then we would get expected results.
Since dynamic content is contextual, it would only show current contacts related records.
Regards,
Clofly