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
Michael MMichael M 

Add fields to html email status report

Hello, we would like to add the Account name to the html email status report. Meaning the Contact's parent Account. Is that possible?
Best Answer chosen by Michael M
VinayVinay (Salesforce Developers) 
Answer would be no.

The EmailStatus object is not queryable directly, but it can be queried indirectly from Leads and Contacts.

https://trailblazer.salesforce.com/ideaView?id=08730000000ZzZUAA0

Try to check below workaround but not sure if this will work.

https://salesforce.stackexchange.com/questions/105824/apex-html-email-status-to-get-open-count

Hope this helps..

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Hi Michael,

Unfortunately, this is not possible,  Kindly review below Idea link and vote for this feature

https://trailblazer.salesforce.com/ideaView?id=08730000000h3huAAA

Thanks,
AbhishekAbhishek (Salesforce Developers) 
And an Idea is already raised for "Additional fields for HTML Email Status Report"

https://trailblazer.salesforce.com/ideaview?id=08730000000Bp2OAAS

Please vote it.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.


 
Michael MMichael M
Aww ok. Thank you. Is there any way to generate a csv or such a report with apex?
Michael MMichael M
Or is there any way to do this via SOQL query? To get contact's account information with email status?
VinayVinay (Salesforce Developers) 
Answer would be no.

The EmailStatus object is not queryable directly, but it can be queried indirectly from Leads and Contacts.

https://trailblazer.salesforce.com/ideaView?id=08730000000ZzZUAA0

Try to check below workaround but not sure if this will work.

https://salesforce.stackexchange.com/questions/105824/apex-html-email-status-to-get-open-count

Hope this helps..

Thanks,
This was selected as the best answer
Michael MMichael M
Ok- so they have this idea: 

SELECT id, name, ( SELECT id, taskId, createdDate, firstOpenDate, lastOpenDate, timesOpened, emailTemplateName FROM EmailStatuses ) FROM Contact

My question is: this returns every single contact. Is it possible to edit the query so that it only includes contacts that were sent a specific email? 
VinayVinay (Salesforce Developers) 
I don't think you can query contacts that were sent specific email.

 
Michael MMichael M
Ok- thank you for the assistnace on this.