|
|
|
@ -179,13 +179,13 @@ public class DefaultNotifications { |
|
|
|
.description("Send notification to tenant admins when any alarm is updated or cleared") |
|
|
|
.build()) |
|
|
|
.build(); |
|
|
|
public static final DefaultNotification deviceAction = DefaultNotification.builder() |
|
|
|
.name("Device action notification") |
|
|
|
public static final DefaultNotification entityAction = DefaultNotification.builder() |
|
|
|
.name("Entity action notification") |
|
|
|
.type(NotificationType.ENTITY_ACTION) |
|
|
|
.subject("${entityType} was ${actionType}") |
|
|
|
.text("${entityType} '${entityName}' was ${actionType} by user ${userEmail}") |
|
|
|
.icon("info").color(null) |
|
|
|
.button("Go to device").link("/devices/${entityId}") |
|
|
|
.button("Go to ${entityType:lowerCase}").link("/${entityType:lowerCase}s/${entityId}") |
|
|
|
.rule(DefaultRule.builder() |
|
|
|
.name("Device created") |
|
|
|
.triggerConfig(EntityActionNotificationRuleTriggerConfig.builder() |
|
|
|
@ -341,7 +341,7 @@ public class DefaultNotifications { |
|
|
|
public NotificationRule toRule(NotificationTemplateId templateId, NotificationTargetId... targets) { |
|
|
|
DefaultRule defaultRule = this.rule; |
|
|
|
NotificationRule rule = new NotificationRule(); |
|
|
|
rule.setName(name); |
|
|
|
rule.setName(defaultRule.getName()); |
|
|
|
rule.setTemplateId(templateId); |
|
|
|
rule.setTriggerType(defaultRule.getTriggerConfig().getTriggerType()); |
|
|
|
rule.setTriggerConfig(defaultRule.getTriggerConfig()); |
|
|
|
|