salesforce中的消息传递。
我实际上是在尝试通过Apex发送电子邮件。所以我得到了此链接 https://help.salesforce.com/s salesforce.com/s /acrateview?id = 000334302& type = 1 。
因此,我在限制为15的开发项目中尝试了它。因此,我将targetObjectObjectID用作Messaging.singleemailMessage中的联系人ID。但是在发送电子邮件后。我可以看到计数正在减少。有人可以在这里帮我吗?
在上面的链接中,如下所示:
每个组织每天可以将单个电子邮件发送至最多5,000个外部电子邮件地址。 “外部电子邮件”是指与联系人,潜在客户或用户无关的任何电子邮件。 直接通过帐户,联系人,联系人,潜在客户,机会,案例,活动或自定义对象页面向您的组织中的联系人,潜在客户,人帐户和用户发送单个电子邮件没有限制。
,为什么我是我的限制在我的组织中减少? 请不要说我在开发组织中尝试的这件代码。
以下是我的代码
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTargetObjectId(targetObjectId);//Contact Id
email.setWhatId(whatId); Account Id
email.setTemplateId(templateId);//Email template Id
email.setCcAddresses(ccRecipientList);//List of Contact Ids
if(attach != null)
email.setFileAttachments(attach); //Attachments if any
I am actually trying to send email through apex. So I got this link https://help.salesforce.com/s/articleView?id=000334302&type=1.
So I tried it in my dev org where the limit is 15. So I am using targetobjectObjectId as contact Id in Messaging.SingleEmailMessage. But after sending email. I could see that the count is reducing. Can someone help me here?
In the above link it says like below:
Each organization can send single emails to a maximum of 5,000 external email addresses per day.
"External emails" refers to any email that's not associated to a Contact, Lead, or User. There’s no limit on sending single emails to contacts, leads, person accounts, and users in your org directly from account, contact, lead, opportunity, case, campaign, or custom object pages.
But why is my limit reducing in my Org?
Please not that this piece of code I am trying in my Dev Org.
Below is my piece of code
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTargetObjectId(targetObjectId);//Contact Id
email.setWhatId(whatId); Account Id
email.setTemplateId(templateId);//Email template Id
email.setCcAddresses(ccRecipientList);//List of Contact Ids
if(attach != null)
email.setFileAttachments(attach); //Attachments if any
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案在于您引用的文档:
您没有通过该记录页面中的标准工具发送该电子邮件。您是通过Apex发送的,因此您应该参考Apex文档
SingleEmailMessage (emphasis mine )
此外
增加电子邮件限制
质量电子邮件限制 通过Salesforce支持增加。您可以要求永久增加,但很少获得批准。
对于单个电子邮件限制。。。。 br>
它们都是高风险功能。
在 case 您必须提供以下信息
The answer lies in the documentation you quoted:
You are not sending that email via standard tools in those record page. You're sending it via apex, so you should refer to apex documentation of
SingleEmailMessage (emphasis mine)
Moreover governor limits doc states:
Increase email limit
Mass Email limit can be temporary increased by Salesforce support. You could ask for a permanent increase, but they are rarely approved.
The same considerations are valid for Single Email Message limit.
They both are High Risk feature.
In the case you must provide the following info: