从 Sitecore 工作流程向具有特定角色的所有用户发送电子邮件
如何向具有 Sitecore 角色的所有用户发送工作流程通知?例如,工作流程的下一步是法律部门批准或拒绝。如何让 Sitecore 向所有担任法律审批者角色的用户发送电子邮件?我试图避免维护通讯组列表,并希望动态获取用户的电子邮件地址。
How can I send workflow notifications to all users in a Sitecore role? For instance, the next step in the workflow is for the Legal department to approve or reject. How can I make Sitecore send emails to all users in the Legal Approver role? I'm trying to avoid maintaining a distribution list and would like to grab users' email addresses dynamically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Sitecore 安全性基于 ASP.NET 安全模型。因此,您可以使用标准的 ASP.NET API 来获取某个角色的用户:
然后迭代找到的用户并读取电子邮件属性:
我可能在语法细节上出错,但我相信您可以弄清楚总体思路。
Sitecore security is based on ASP.NET security model. Hence, you can use standard ASP.NET API to obtain users of a certain role:
And later on iterate through the found users and read Email property:
I might be mistaken in syntax details, but I'm sure you can figure it out knowing the general idea.
要解析间接成员资格,您可以使用
Sitecore.Security.Accounts.RolesInRolesManager
,它还会返回属于指定角色的间接部分的用户帐户。To resolve indirect membership you can use the
Sitecore.Security.Accounts.RolesInRolesManager
which also returns user accounts which are indirect part of the role specified.