Send list of opportunities with opportunity-specific info on each to sales owner | Community
Skip to main content
michaelstancil
New Participant
March 4, 2022
Question

Send list of opportunities with opportunity-specific info on each to sales owner

  • March 4, 2022
  • 1 reply
  • 3254 views

Hi all,

 

I have a situation where I am sending emails to opportunities based on specific conditions, and then I need to notify the sales owner of the opportunity that the email has been sent with the opportunity-specific information. I've combed the forums and cobbled together something that finally sends, but does not print anything, even when it's replaced with a hardcoded sales owner email address that should deliver a result. The email of the sales owner is within the opportunity object, with two possible places of occuring.

 

This would be the email content of the notification email sent.

 

 

## Filter List #set( $specificList = [] ) #foreach( $Opp in $OpportunityList ) #if( !$OpportunityList.Trigger.isEmpty() && $OpportunityList.PossibleSalesOwnerEmailOne == $lead.SalesOwnerEmailOne || !$OpportunityList.PossibleSalesOwnerEmailTwo == $lead.SalesOwnerEmailTwo ) #set( $void = $specificList.add($Opp) ) #end #end ## Display List of Specific Items #foreach( $Opp in $specificList ) Field1: ${OpportunityList.Field1} Field2: ${OpportunityList.Field2} Field3: ${OpportunityList.Field3} </br> #end

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
March 4, 2022

Hmm... you keep checking properties of the List itself, not the List item ($Opp), so that's never gonna match anything.

michaelstancil
New Participant
March 4, 2022

@sanfordwhiteman Ah - thanks for that. Though I did make that update to Opp from OpportunityList, but I'm still seeing no value. I looked at the raw output and it's empty as well. The token contents should be right underneath the first <br />

 

<div> A new Sales Alert was sent. <br /> <br /> <br /> </div> </div>

 

SanfordWhiteman
New Participant
March 4, 2022

That was only the first step, to make sure you were checking for properties in the right place. Tell me about your Opportunities -- what's this trigger property?

 

I would also be explicit about the condition here, and always use equals():

#if( !$OpportunityList.Trigger.isEmpty() && ( $OpportunityList.PossibleSalesOwnerEmailOne.equals($lead.SalesOwnerEmailOne) || !$OpportunityList.PossibleSalesOwnerEmailTwo.equals($lead.SalesOwnerEmailTwo) ) )