在wso2is 5.10.0中添加/更新/删除用户角色后发送通知

时间:2020-05-29 18:16:56

标签: wso2 wso2is

我正在使用WSO2IS 5.10.0,因此我需要在添加,更新或删除任何用户的用户角色后发送通知电子邮件。为此,我参考了这个wso2文档12,但是它没有按预期工作。是否有解决方法?

1 个答案:

答案 0 :(得分:0)

  1. 如本document中所述,首先您需要配置输出事件适配器,以配置需要用于发送电子邮件通知的电子邮件帐户
  2. 然后,您需要为该document中提到的用户操作事件订阅电子邮件发件人模块。

例如,要在添加,更新或删除用户角色后配置电子邮件通知, identity-event.properties文件中的示例配置如下所示:

module.name.2=emailSend
emailSend.subscription.1=TRIGGER_NOTIFICATION
emailSend.subscription.2=POST_ADD_ROLE
emailSend.subscription.3=POST_UPDATE_ROLE
emailSend.subscription.4=POST_DELETE_ROLE

但是由于IS5.9.0引入了新的配置模型,因此将直接将此配置直接添加到 identity-event.properties中

因此,您必须将以下配置直接添加到Deployment.toml 文件中。

  [identity_mgt.events.schemes.emailSend]
subscriptions = [
       "TRIGGER_NOTIFICATION",
       "POST_ADD_ROLE",
       "POST_UPDATE_ROLE",
       "POST_DELETE_ROLE"
     ]

[identity_mgt.events.schemes.emailSend.properties]
'subscription.POST_ADD_ROLE.template' = "testDelete"

您可以在此处为每个订阅在属性下添加属性。

您可以参考这个identity-event.properties.j2文件以获取更多参考。 https://github.com/wso2/carbon-identity-framework/blob/master/features/identity-event/org.wso2.carbon.identity.event.server.feature/resources/identity-event.properties.j2

您可以参考此blog以获得更多信息。