Method
findDeals — find deals for a specific entity by filtering with entity id
Description
Minimum number of arguments for this method is two. The first argument is the entity name and the second is the entity id.
Structure of the method:
findDeals('Entity Name', 'Entity Id')
Parameters
Entity Name
— The entity name like lead
Entity Id
— The entity id like the id of a lead
Examples
If you are creating an email template on the leads entity, you have the lead object captured and can use its information like {{first_name}}, {{id}}, etc.
In the example below, we use the id of the lead to get all its deals.
//Find all deals for a specific lead. Hello {{first_name}}, {% set deals = findDeals('lead',id)%} Your Deals: {% for deal in deals%} {{deal.name}} - {{deal.amount}} - {{deal.close_date}} {%endfor%} //Output: List of name - amount - closed_date of deals for the lead with its current id
To stay updated with the latest features, news and how-to articles and videos, please join our group on Facebook, Flexie CRM Academy.