diff options
Diffstat (limited to 'src/main/java/org/traccar/notification')
-rw-r--r-- | src/main/java/org/traccar/notification/NotificationFormatter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/notification/NotificationFormatter.java b/src/main/java/org/traccar/notification/NotificationFormatter.java index e994729c0..7685eac0d 100644 --- a/src/main/java/org/traccar/notification/NotificationFormatter.java +++ b/src/main/java/org/traccar/notification/NotificationFormatter.java @@ -23,6 +23,7 @@ import org.traccar.model.Driver; import org.traccar.model.Event; import org.traccar.model.Geofence; import org.traccar.model.Maintenance; +import org.traccar.model.Notification; import org.traccar.model.Position; import org.traccar.model.Server; import org.traccar.model.User; @@ -44,13 +45,15 @@ public class NotificationFormatter { this.textTemplateFormatter = textTemplateFormatter; } - public NotificationMessage formatMessage(User user, Event event, Position position, String templatePath) { + public NotificationMessage formatMessage( + Notification notification, User user, Event event, Position position, String templatePath) { Server server = cacheManager.getServer(); Device device = cacheManager.getObject(Device.class, event.getDeviceId()); VelocityContext velocityContext = textTemplateFormatter.prepareContext(server, user); + velocityContext.put("notification", notification); velocityContext.put("device", device); velocityContext.put("event", event); if (position != null) { |