Browse Source

Available delivery methods check: don't check mail server connection

pull/8423/head
ViacheslavKlimov 3 years ago
parent
commit
f44de42165
  1. 5
      application/src/main/java/org/thingsboard/server/service/mail/DefaultMailService.java
  2. 6
      application/src/main/java/org/thingsboard/server/service/notification/channels/EmailNotificationChannel.java
  3. 2
      rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/MailService.java
  4. 2
      ui-ngx/src/assets/help/en_US/notification/alarm.md
  5. 2
      ui-ngx/src/assets/help/en_US/notification/alarm_assignment.md
  6. 2
      ui-ngx/src/assets/help/en_US/notification/alarm_comment.md
  7. 2
      ui-ngx/src/assets/help/en_US/notification/api_usage_limit.md
  8. 2
      ui-ngx/src/assets/help/en_US/notification/device_activity.md
  9. 2
      ui-ngx/src/assets/help/en_US/notification/entities_limit.md
  10. 2
      ui-ngx/src/assets/help/en_US/notification/entity_action.md
  11. 2
      ui-ngx/src/assets/help/en_US/notification/general.md
  12. 2
      ui-ngx/src/assets/help/en_US/notification/new_platform_version.md
  13. 2
      ui-ngx/src/assets/help/en_US/notification/rule_engine_lifecycle_event.md
  14. 2
      ui-ngx/src/assets/help/en_US/notification/rule_node.md

5
application/src/main/java/org/thingsboard/server/service/mail/DefaultMailService.java

@ -364,6 +364,11 @@ public class DefaultMailService implements MailService {
mailSender.testConnection();
}
@Override
public boolean isConfigured(TenantId tenantId) {
return mailSender != null;
}
private String toEnabledValueLabel(ApiFeature apiFeature) {
switch (apiFeature) {
case DB:

6
application/src/main/java/org/thingsboard/server/service/notification/channels/EmailNotificationChannel.java

@ -49,10 +49,8 @@ public class EmailNotificationChannel implements NotificationChannel<User, Email
@Override
public void check(TenantId tenantId) throws Exception {
try {
mailService.testConnection(tenantId);
} catch (Exception e) {
throw new RuntimeException("Mail server is not available");
if (!mailService.isConfigured(tenantId)) {
throw new RuntimeException("Mail server is not configured");
}
}

2
rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/MailService.java

@ -54,4 +54,6 @@ public interface MailService {
void testConnection(TenantId tenantId) throws Exception;
boolean isConfigured(TenantId tenantId);
}

2
ui-ngx/src/assets/help/en_US/notification/alarm.md

@ -17,7 +17,7 @@ Available template parameters:
* `alarmOriginatorEntityType` - the entity type of the alarm originator, e.g. 'Device';
* `alarmOriginatorName` - the name of the alarm originator, e.g. 'Sensor T1';
* `alarmOriginatorId` - the alarm originator entity id as uuid string;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/alarm_assignment.md

@ -26,7 +26,7 @@ Available template parameters:
* `userFirstName` - first name of the user who made the action;
* `userLastName` - last name of the user who made the action;
* `action` - one of: 'assigned', 'unassigned';
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/alarm_comment.md

@ -22,7 +22,7 @@ Available template parameters:
* `userEmail` - email of the user who made the action;
* `userFirstName` - first name of the user who made the action;
* `userLastName` - last name of the user who made the action;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/api_usage_limit.md

@ -18,7 +18,7 @@ Available template parameters:
* `currentValue` - current number of used units;
* `tenantId` - id of the tenant;
* `tenantName` - name of the tenant;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/device_activity.md

@ -14,7 +14,7 @@ Available template parameters:
* `deviceLabel` - the device label;
* `deviceType` - the device type;
* `eventType` - one of: 'inactive', 'active';
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/entities_limit.md

@ -15,7 +15,7 @@ Available template parameters:
* `percents` - the percent from the notification rule configuration;
* `tenantId` - id of the tenant;
* `tenantName` - name of the tenant;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/entity_action.md

@ -18,7 +18,7 @@ Available template parameters:
* `userEmail` - email of the user who made the action;
* `userFirstName` - first name of the user who made the action;
* `userLastName` - last name of the user who made the action;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/general.md

@ -9,7 +9,7 @@ See the available types and parameters below:
Available template parameters:
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/new_platform_version.md

@ -14,7 +14,7 @@ Available template parameters:
* `upgradeInstructionsUrl` - upgrade instructions link for latest version;
* `currentVersion` - the current platform version
* `currentVersionReleaseNotesUrl` - release notes link for current version;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/rule_engine_lifecycle_event.md

@ -17,7 +17,7 @@ Available template parameters:
* `eventType` - one of: 'started', 'updated', 'stopped';
* `action` - one of: 'start', 'update', 'stop';
* `error` - the error text;
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

2
ui-ngx/src/assets/help/en_US/notification/rule_node.md

@ -14,7 +14,7 @@ Available template parameters:
* `originatorType` - type of the originator, e.g. 'Device';
* `originatorId` - id of the originator
* `msgType` - type of the message
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise)
* `recipientTitle` - title of the recipient (first and last name if specified, email otherwise);
* `recipientEmail` - email of the recipient;
* `recipientFirstName` - first name of the recipient;
* `recipientLastName` - last name of the recipient;

Loading…
Cancel
Save