salesforce中的消息传递。

发布于 2025-01-21 18:15:29 字数 1009 浏览 0 评论 0原文

我实际上是在尝试通过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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除会话 2025-01-28 18:15:29

答案在于您引用的文档:

直接来自帐户,联系,潜在客户,机会,案例,活动或自定义对象页面

您没有通过该记录页面中的标准工具发送该电子邮件。您是通过Apex发送的,因此您应该参考Apex文档
SingleEmailMessage (emphasis mine )

setccaddresses(ccaddresses)
选修的。您将电子邮件发送给联系人,潜在客户和用户的Carbon Copy(CC)地址或对象ID列表。该字段的最大尺寸为4,000个字节。每封电子邮件的toaddresses,ccaddresses和bccaddresses的总数最高为150。

此外

如果您使用单个eMailMessage向您的组织内部用户发送电子邮件,则在SettarGetObjectID中指定用户的ID意味着该电子邮件不计入每日限制。但是,在settoaddresses中指定内部用户的电子邮件地址意味着该电子邮件确实计入了极限


增加电子邮件限制

质量电子邮件限制 通过Salesforce支持增加。您可以要求永久增加,但很少获得批准。

对于单个电子邮件限制。。。。 br>
它们都是高风险功能。

case 您必须提供以下信息

  • : >公司信息)
  • 您想要的确切新限制,
  • 该组织的持续时间是
  • 详细且强大的业务案例

The answer lies in the documentation you quoted:

directly from account, contact, lead, opportunity, case, campaign, or custom object pages

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)

setCcAddresses(ccAddresses)
Optional. A list of carbon copy (CC) addresses or object IDs of the contacts, leads, and users you’re sending the email to. The maximum size for this field is 4,000 bytes. The maximum total of toAddresses, ccAddresses, and bccAddresses per email is 150. All recipients in these three fields count against the limit for email sent using Apex or the API.

Moreover governor limits doc states:

If you use SingleEmailMessage to email your org’s internal users, specifying the user’s ID in setTargetObjectId means the email doesn’t count toward the daily limit. However, specifying internal users’ email addresses in setToAddresses means the email does count toward the limit.


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:

  • Organization ID (Setup > Company Information)
  • The exact new limit you want for your org
  • The duration for which the increase is requested
  • A detailed and strong business case
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文