Sunday, September 24, 2023
HomeApex2019 : How to find Email Statistics from Salesforce?

2019 : How to find Email Statistics from Salesforce?

Querying HTML Email Status Object

Salesforce provides the ability to send email from the native interface using their Email Panel. They also provided the ability to track to a certain degree of the email sent via the HTML Email Status object.

The challenge here is that this particular object is not accessible from the Object Manager via the Setup.

Many administrator will wants to have the ability to configure and customise this object. Vote for this idea,

After some research, we found that there’s a workaround for this. I can’t take credit for this but its well documented in the stack exchange, see link below.

You can query it from Apex level, which is the basic coding language of Salesforce.

An example:

Select Name, AccountId, (Select Id, EmailTemplateName From EmailStatuses) From Contact WHERE AccountId = ‘<Salesforce Object Id>’

Note that this EmailStatues object is only related to Leads, Contacts and Person Accounts.

Therefore if you are looking to have an aggregated summary of the email send via the account, you will have to run multiple statements (on leads, contact and person account).



Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments