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
kush1234kush1234 

fromAddress in apex:emailPublisher

I have been struggling to add a display name along with email address when specifying fromAddres attribute for emailPublisher. This is both the case when creating a custom publisher component or when specifying fromAddress in edit feed page layout. My goal is to use a default email address for all case emails. And it isn't possible to set an org-wide email address as the default from address, so I used fromAddress attribute, but the problem is that the from email address shows something like this: "support@keeptruckin.com <support@abc.com>" whereas I want it to be "Abc Support <support@abc.com>"
Ashish_SFDCAshish_SFDC
Hi , 


The solution is that to create an organization wide email address and set it to all profiles which would work for guest user profile as well. On the code , just call the following

List<OrgWideEmailAddress> lstOrgWideEmailId = [Select id from OrgWideEmailAddress];
if(lstOrgWideEmailId.size() == 0)
{
   throw(new PkException('There is no Organization wide email address setup in the org. Please set the organization wide email address'));
}
else
{
    orgWideEmailAddressID = lstOrgWideEmailId[0].id;   
}
email.setOrgWideEmailAddressId(orgWideEmailAddressID);


http://salesforce.stackexchange.com/questions/13126/changing-sender-email-display-name-on-force-com-sites


Regards,
Ashish