0

I am working on a requirement and needs to know how to know if our org. has sent more than a 1000 emails on a specific date.

I have found the following code :

System.debug('limits.getEmailInvocations()                 = ' + limits.getEmailInvocations());
System.debug('limits.getLimitEmailInvocations()            = ' + limits.getLimitEmailInvocations());

found from https://gist.github.com/tyoshikawa1106/e28b602f82582cf119ae

But they can't be used for a specific date. is there any other way using workbench etc.

2

There's no way to get that information programmatically. The Limits class only tells you the usage for the current transaction, not for the entire day. You can use the setup menu to request an email log file, but this is run asynchronously.

  • So there is no way to get email sent on a specific date using soql/ API. – cloudy-ritz Jun 10 '16 at 14:25
  • 1
    @cloudlover If you're just concerned about if you're going to hit the limit, you can use reserve*EmailCapacity functions before you try to send the emails. – sfdcfox Jun 10 '16 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.