function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Laura StanleyHubbardLaura StanleyHubbard 

Send an Email Button in Case Feed View does NOT populate with Case Contact

I have built a macro to streamline some of our processes, but Macros only run in the feed view, and here is my dilemma. When I send an email in the Detail View of a case, the 'To' field auto populates to whoever the contact is on the case. In the Feed View, this doens't happen. Is this a bug in the system? Default functionality?

I'm thinking I should make a custom button to add to the feed view that automatically pulls in the Contact info. Any suggestions on how to do that? Code? I don't want to hardcode a contact into the macro. It should be dependent on the contact on the case.
Andy BoettcherAndy Boettcher
Can you share the macro/code you have running?  Be sure to use the code formatter ("< >" button) to format it so we can read it.  =)
Laura StanleyHubbardLaura StanleyHubbard
1. Macro attached below. I only need an email to be generated (related to contact on the case) and an HTML template attached. A person-specific PDF has to be attached, so our end user has to finalize the rest.

User-added image
2. From Detail View, sending an email automatically inserts the contact name/email on the case:

User-added image

3. Feed View of the same case doesn't insert the case contact/name:

User-added image
 
Paul DPaul D
Hi Laura,

You posted this a while back, so perhaps you've figured this out already, but in case you haven't, I had this same problem today.

The issue was due to the fact that I was testing the macro with a contact that had the same email address as my Salesforce user.

This page (https://help.salesforce.com/apex/HTViewSolution?urlname=How-is-the-To-field-populated-in-the-Case-Feed-Email-Answer-Customer-Publisher&language=en_US) contains the rules for how it determines who to populate the 'To:' field.

In my case as I was able to send the first test email with the macro fine, the specific rule stopping the 'To:' field from being populated was - 

'When the last Email on the Case is Outbound, TO will default as all TO addresses from that last email, excluding any addresses the current User can send Case Email 'From' (e.g. Excluding Addresses listed in the From picklist when composing email from the Case).'

As the 'To' address was the same as my send 'From' address, it was excluded.

I hope this helps.