added loop email tokens for CustomObjectsBundle which helps to send e…#382
added loop email tokens for CustomObjectsBundle which helps to send e…#382Ravi-topchunks wants to merge 4 commits into
Conversation
…mails with the list of custom items from an Object
|
this PR contains email tokens which provides loop tokens this helps to add top products into the email with LIMIT. Please have a look at emailtokens.md |
escopecz
left a comment
There was a problem hiding this comment.
I think I'm commenting on the same things as our CI will. I let it run first.
escopecz
left a comment
There was a problem hiding this comment.
Can you please also provide functional tests for this feature? You can reuse these instructions for your AI agent:
https://github.com/mautic/mautic/blob/7.x/.github/prompts/write-test.prompt.md
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please remove the |
…mails with the list of custom items from an Object
Description:
DOCS
Custom object loop tokens
Custom items can be rendered in emails (or other content) using loop tokens.
Basic syntax
{custom-object-loop ...}: Opens the loop and defines which custom items to load.{/custom-object-loop}: Closes the loop. Everything between the opening and closing tags is repeated for each matching custom item.Loop parameters (
custom-object-loop)product-views). Required.segment-filteris implemented so far (and it is the default if omitted).WHEREconditions.latestis supported (and is the default if omitted).1if not provided.1, multiple items are rendered.Loop-value parameters (
custom-object-loop-value)objectused in the surroundingcustom-object-loop. If it does not match, it is ignored.name,price,color).default=Unknown).Examples
List product names bought by the contact:
Rendered example:
Render a small HTML block per product:
{custom-object-loop object=product-views | where=segment-filter | order=latest | limit=2} <div class="product"> <strong>{custom-object-loop-value object=product-views | field=name | default=Unknown}</strong><br> Price: {custom-object-loop-value object=product-views | field=price | default=0}<br> Color: {custom-object-loop-value object=product-views | field=color | default=Unknown} </div> {/custom-object-loop}Rendered HTML (for 2 products):
Warnings and limitations
ORconditions in the source segments for custom object filters.Steps to test this PR: