Available delivery methods check: don't check mail server connection
This commit is contained in:
parent
0ce243f2e7
commit
f44de42165
@ -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:
|
||||
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,4 +54,6 @@ public interface MailService {
|
||||
|
||||
void testConnection(TenantId tenantId) throws Exception;
|
||||
|
||||
boolean isConfigured(TenantId tenantId);
|
||||
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user