我想将从工作流程发送的电子邮件更改为发送给其他收件人,即当前用户的经理。我可以通过重建所有工作流程来做到这一点,但我想知道是否有任何方法可以在 EmailMessage 对象的触发器中执行此操作,以便这适用于发送的每封电子邮件。我尝试过这样做,但似乎从工作流发送的电子邮件不会经过此对象。
最佳答案
作为构建触发器的替代方法,您可以在 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>
单击“确定”,系统会将经理添加为所有工作流程电子邮件警报的收件人。
如果您想变得更奇特,请使用正则表达式。
关于salesforce - 是否可以为从工作流程发送的电子邮件创建触发器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9772573/