I am working on the on service cloud so it is very important for our agents to send email from case and they always use it to send emails.

For that I have created email action and added this to chatter. Upto here it is fine. But, The agents wants to send the emails to Contacts. I have set the predefine values of "ToAddress" to this formula:

IF( Case.ContactEmail != Null, Case.ContactEmail, Case.SuppliedEmail ) 

But, I observed that salesforce takes the case.SuppliedEmail even if there is contact linked to Case.

Can you please suggest me workaround for this standard behaviour of salesforce.

Much Thank in Advance!!

2 Answers 2


To send the email from action, you don't need to define pre-defined 'ToAdress' field.

By default, it takes contact email id like this way.

Email Publisher

  • I agree with you. It's true. But in my case the emails are coming from Email-To-Case and in this case the 'toAddress' is populated by the suppliedEmail. Looking forward for your thought. Commented Dec 11, 2019 at 10:16

If you use the standard Email Action, You don't need to pre-define the value of ToAddress field whereas if you created a custom case object specific Email Action, You need to Pre-define the value of ToAddress field.

enter image description here

The below action will be automatically enabled when you enable email-to-case in the org. To Recipients field is already pre-defined.

enter image description here

Now coming to your question,The below formula works well for me.

 IF( Case.ContactEmail != Null, Case.ContactEmail, Case.SuppliedEmail ) 

See the screenshot below. It case detail has contact linked with it and it picked the contact email in the action.

enter image description here

whereas when i delete the contact from Case, It picks the web email as per formula.

enter image description here

  • Thanks for detailed response. One think I like to know if the case you created was from web or email2case? Commented Dec 11, 2019 at 11:47
  • It has been created from web. I have not created it with email2case. Commented Dec 11, 2019 at 11:55
  • yes if it's from email2case then it is picking suppliedemail whatsoever the predefine value. Commented Dec 11, 2019 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .