diff options
-rw-r--r-- | src/main/java/org/traccar/notification/TextTemplateFormatter.java | 15 | ||||
-rw-r--r-- | templates/full/unknown.vm | 7 | ||||
-rw-r--r-- | templates/short/unknown.vm | 2 |
3 files changed, 2 insertions, 22 deletions
diff --git a/src/main/java/org/traccar/notification/TextTemplateFormatter.java b/src/main/java/org/traccar/notification/TextTemplateFormatter.java index ab90d76d4..cc6935982 100644 --- a/src/main/java/org/traccar/notification/TextTemplateFormatter.java +++ b/src/main/java/org/traccar/notification/TextTemplateFormatter.java @@ -75,19 +75,8 @@ public class TextTemplateFormatter { } public Template getTemplate(String name, String path) { - - String templateFilePath; - Template template; - - try { - templateFilePath = Paths.get(path, name + ".vm").toString(); - template = velocityEngine.getTemplate(templateFilePath, StandardCharsets.UTF_8.name()); - } catch (ResourceNotFoundException error) { - LOGGER.warn("Notification template error", error); - templateFilePath = Paths.get(path, "unknown.vm").toString(); - template = velocityEngine.getTemplate(templateFilePath, StandardCharsets.UTF_8.name()); - } - return template; + String templateFilePath = Paths.get(path, name + ".vm").toString(); + return velocityEngine.getTemplate(templateFilePath, StandardCharsets.UTF_8.name()); } public NotificationMessage formatMessage(VelocityContext velocityContext, String name, String templatePath) { diff --git a/templates/full/unknown.vm b/templates/full/unknown.vm deleted file mode 100644 index 566ce0d42..000000000 --- a/templates/full/unknown.vm +++ /dev/null @@ -1,7 +0,0 @@ -#set($subject = "Unknown type") -<!DOCTYPE html> -<html> -<body> -Unknown type -</body> -</html> diff --git a/templates/short/unknown.vm b/templates/short/unknown.vm deleted file mode 100644 index 2f9d5e3af..000000000 --- a/templates/short/unknown.vm +++ /dev/null @@ -1,2 +0,0 @@ -#set($subject = "Unknown type") -Unknown type |