是否可以为从工作流发送的电子邮件创建触发器?

时间:2012-03-19 15:05:13

标签: salesforce

我想将工作流程中发送的电子邮件更改为发送给其他收件人,即当前用户的管理员。我可以通过重建我的所有工作流程来实现这一点,但我想知道是否有任何方法可以在EmailMessage对象的触发器中执行此操作,以便这适用于发送的每封电子邮件。我试图这样做,但似乎从工作流程发送的电子邮件不会通过此对象。

2 个答案:

答案 0 :(得分:1)

作为构建触发器的替代方法,您可以在eclipse中进行搜索和替换以添加收件人。

你从这个

开始
<alerts>
  ...
  <recipients>
    <field>Engineer_s_Email__c</field>
    <type>email</type>
  </recipients>
  <recipients>
    <recipient>jason.bourne@salesforce.com</recipient>
    <type>user</type>
  </recipients>
  ...
</alerts>

然后进行文件搜索并替换(ctrl-h)。搜索</alerts>并替换为<recipients><recipient>manager.john@salesforce.com</recipient><type>user</type></recipients></alerts>。哪个会给你:

<alerts>
  ...
  <recipients>
    <field>Engineer_s_Email__c</field>
    <type>email</type>
  </recipients>
  <recipients>
    <recipient>jason.bourne@salesforce.com</recipient>
    <type>user</type>
  </recipients>
  ...
<recipients><recipient>manager.john@salesforce.com</recipient><type>user</type></recipients></alerts></alerts>

单击“确定”,它会将管理员添加为所有工作流电子邮件警报的收件人。

如果你想获得幻想,请使用正则表达式。

答案 1 :(得分:0)

EmailMessage对象与Cases直接相关;它在Setup |中找到案例|电子邮件(如Winter 10 Release Notes中所述)。它用于入站电子邮件(通常具有“电子邮件到案例”功能)。因此,我认为它不涉及与工作流相关联的出站电子邮件警报功能。

不幸的是,我知道向所有工作流添加额外收件人的唯一方法是修改每个工作流规则。

相关问题