we currently send 2,500 emails to our customers (they all have accounts). These emails include invoices, appointments etc. These are operational emails on a daily basis. We are ramping up these emails to possibly 10,000 to 15,000 per day. We will not be able to send these. Do we have to use an external app for this as SF cannot do this. Compared to many large companies on SF, we are a medium sized company - what do other companies do? thanks for any advice
1 Answer
As per this knowledge article:
- the 2500 emails limit only applies to emails sent using "external email addresses" (actually, that means emails sent using an email address rather than using a recipient object).
- if you ensure that all email sending is done using User objects as the recipients there are no limits at all.
It comes down to how you invoke the email sending. As long as you pass the ID of the User object that has the email address as a field within it (using Messaging.SingleEmailMessage
's setTargetObjectId
for example) the sending doesn't count towards the limits. If you get the email address out of the object then pass that instead (using Messaging.SingleEmailMessage
's setToAddresses
for example) this will count against the limits.
Note that uses of setTargetObjectId
with other types of object than User do, unfortunately, count towards limits (something I forgot about when originally answering this quesion). The main problem here is inconsistent and unclear documentation!
NB: If you have a list of email addresses, you can minimize the number of counted email sends to those where users or community users don't match these addresses. To find those that do match use a query like:
SELECT Id, Email, Contact.Email FROM User WHERE Email IN :emails OR Contact.Email IN :emails
This allows use of the Id
from the User
object when sending, via setTargetObjectId
. Not all email addresses would be mapped so you must find any not covered by the returned data and send emails to those directly (using limits).
-
thanks Phil. I am using the customer account's email address. The fact that they are customers on our system should mean that they are not external email addresses or am I understanding this incorrectly? Commented Jul 29, 2020 at 12:40
-
-
N.B.
setTargetObjectId
includesLead
as well asUser
andContact
– cropredyCommented Jul 29, 2020 at 23:46 -
1@cropredy, I aligned my answer fully withe valid target objects now.– Phil WCommented Jul 30, 2020 at 6:22
-
thanks Phil/Cropredy, we hold the email address in the Accounts object. If I pass the Account ID, will that just pick up the email address field? Commented Jul 31, 2020 at 8:15