aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification/NotificationFormatter.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-28 17:07:25 +1200
committerGitHub <noreply@github.com>2018-06-28 17:07:25 +1200
commite849d3a56f55c83dc0ebed02165a124e30e22dbd (patch)
tree730e542145652ca1d06c64a6944dfa70e0b31b6b /src/org/traccar/notification/NotificationFormatter.java
parent4d6229c7daa4a7b8f28337c5eca9a422876c98b1 (diff)
parent14840af2abd9976b8f5634af8e77f4a7126dfac1 (diff)
downloadtrackermap-server-e849d3a56f55c83dc0ebed02165a124e30e22dbd.tar.gz
trackermap-server-e849d3a56f55c83dc0ebed02165a124e30e22dbd.tar.bz2
trackermap-server-e849d3a56f55c83dc0ebed02165a124e30e22dbd.zip
Merge pull request #3950 from Abyss777/notification_refactor
Notification refactor to allow custom "notificators"
Diffstat (limited to 'src/org/traccar/notification/NotificationFormatter.java')
-rw-r--r--src/org/traccar/notification/NotificationFormatter.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java
index 524153721..c011403c5 100644
--- a/src/org/traccar/notification/NotificationFormatter.java
+++ b/src/org/traccar/notification/NotificationFormatter.java
@@ -88,18 +88,15 @@ public final class NotificationFormatter {
return template;
}
- public static MailMessage formatMailMessage(long userId, Event event, Position position) {
- String templatePath = Context.getConfig().getString("mail.templatesPath", "mail");
+ public static FullMessage formatFullMessage(long userId, Event event, Position position) {
VelocityContext velocityContext = prepareContext(userId, event, position);
- String formattedMessage = formatMessage(velocityContext, userId, event, position, templatePath);
+ String formattedMessage = formatMessage(velocityContext, userId, event, position, "full");
- return new MailMessage((String) velocityContext.get("subject"), formattedMessage);
+ return new FullMessage((String) velocityContext.get("subject"), formattedMessage);
}
- public static String formatSmsMessage(long userId, Event event, Position position) {
- String templatePath = Context.getConfig().getString("sms.templatesPath", "sms");
-
- return formatMessage(null, userId, event, position, templatePath);
+ public static String formatShortMessage(long userId, Event event, Position position) {
+ return formatMessage(null, userId, event, position, "short");
}
private static String formatMessage(VelocityContext vc, Long userId, Event event, Position position,