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
Stephanie DodsonStephanie Dodson 

Help needed on a custom email action

I am trying to create a custom action for case feeds called "Reply All".  I have created a visualforce page and a custom action and it seems to be working ok but missing a few pieces.

I need to refresh the page after the email is sent. 
Also, I need to pass values to the To and CC address fields.

Here is what I have:

<apex:page standardController="Case" >
<apex:emailPublisher entityId="{!case.id}"
autoCollapseBody="false"
emailBodyFormat="textAndHTML"
emailBodyHeight="200em"
bccVisibility="editableWithLookup"
ccvisibility="editableWithLookup"
expandableHeader="false"
fromvisibility="selectable"
showadditionalFields="true"
showattachments="true"
showsendButton="true"
showtemplates="true"
subjectvisibility="editable"
tovisibility="editableWithLookup"
/>
</apex:page>


 
Best Answer chosen by Stephanie Dodson
pconpcon
You can set the to addresses by setting the toAddresses fields [1].  Currently you cannot set the cc address fields [2] on the emailPublisher.  You can refresh the page by setting an Id on your apex:page and then using the reRender attribute on the emailPublisher tag
 
<apex:page standardController="Case" id="thePage">
    <apex:emailPublisher entityId={!Case.Id}"
        reRender="thePage"
        ...
        />
</apex:page>

[1] https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_emailPublisher.htm
[2] https://success.salesforce.com/ideaView?id=08730000000kr1zAAA

All Answers

pconpcon
You can set the to addresses by setting the toAddresses fields [1].  Currently you cannot set the cc address fields [2] on the emailPublisher.  You can refresh the page by setting an Id on your apex:page and then using the reRender attribute on the emailPublisher tag
 
<apex:page standardController="Case" id="thePage">
    <apex:emailPublisher entityId={!Case.Id}"
        reRender="thePage"
        ...
        />
</apex:page>

[1] https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_emailPublisher.htm
[2] https://success.salesforce.com/ideaView?id=08730000000kr1zAAA
This was selected as the best answer
Stephanie DodsonStephanie Dodson
Can we reRender with the publisher collapsed?
pconpcon
According to the documentation, it will rerender when the email is successfully sent.  So if it can be sent with the publisher collapsed then yes.  Otherwise you would need to have another component on the page do the reRender.