diff options
author | Ivan Martinez <ivanfmartinez@users.noreply.github.com> | 2018-06-01 07:34:35 -0300 |
---|---|---|
committer | Ivan Martinez <ivanfmartinez@users.noreply.github.com> | 2018-06-01 07:34:35 -0300 |
commit | 50a80d68516890aa3ec5c2826f929474927def30 (patch) | |
tree | d0c0a2885fa9fcffa94ed600cda45090b81eaaaf /src | |
parent | 25eb3d86b97f8a0eb806f3e0c572d80c495257d6 (diff) | |
download | trackermap-server-50a80d68516890aa3ec5c2826f929474927def30.tar.gz trackermap-server-50a80d68516890aa3ec5c2826f929474927def30.tar.bz2 trackermap-server-50a80d68516890aa3ec5c2826f929474927def30.zip |
generic template names
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/notification/NotificationFormatter.java | 8 | ||||
-rw-r--r-- | src/org/traccar/notification/NotificationMail.java | 2 | ||||
-rw-r--r-- | src/org/traccar/notification/NotificationSms.java | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java index 114825a83..d1f6c3903 100644 --- a/src/org/traccar/notification/NotificationFormatter.java +++ b/src/org/traccar/notification/NotificationFormatter.java @@ -85,16 +85,16 @@ 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 MailMessage formatFullMessage(long userId, Event event, Position position) { + String templatePath = Context.getConfig().getString("message.full.templatesPath", "full"); VelocityContext velocityContext = prepareContext(userId, event, position); String formattedMessage = formatMessage(velocityContext, userId, event, position, templatePath); return new MailMessage((String) velocityContext.get("subject"), formattedMessage); } - public static String formatSmsMessage(long userId, Event event, Position position) { - String templatePath = Context.getConfig().getString("sms.templatesPath", "sms"); + public static String formatShortMessage(long userId, Event event, Position position) { + String templatePath = Context.getConfig().getString("message.short.templatesPath", "short"); return formatMessage(null, userId, event, position, templatePath); } diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java index 3a2a19337..fb89bf5bd 100644 --- a/src/org/traccar/notification/NotificationMail.java +++ b/src/org/traccar/notification/NotificationMail.java @@ -108,7 +108,7 @@ public final class NotificationMail extends Notificator { } message.addRecipient(Message.RecipientType.TO, new InternetAddress(user.getEmail())); - MailMessage mailMessage = NotificationFormatter.formatMailMessage(userId, event, position); + MailMessage mailMessage = NotificationFormatter.formatFullMessage(userId, event, position); message.setSubject(mailMessage.getSubject()); message.setSentDate(new Date()); message.setContent(mailMessage.getBody(), "text/html; charset=utf-8"); diff --git a/src/org/traccar/notification/NotificationSms.java b/src/org/traccar/notification/NotificationSms.java index a8eaff798..804fa8527 100644 --- a/src/org/traccar/notification/NotificationSms.java +++ b/src/org/traccar/notification/NotificationSms.java @@ -30,7 +30,7 @@ public final class NotificationSms extends Notificator { if (user.getPhone() != null) { Context.getStatisticsManager().registerSms(); Context.getSmsManager().sendMessageAsync(user.getPhone(), - NotificationFormatter.formatSmsMessage(userId, event, position), false); + NotificationFormatter.formatShortMessage(userId, event, position), false); } } @@ -41,7 +41,7 @@ public final class NotificationSms extends Notificator { if (user.getPhone() != null) { Context.getStatisticsManager().registerSms(); Context.getSmsManager().sendMessageSync(user.getPhone(), - NotificationFormatter.formatSmsMessage(userId, event, position), false); + NotificationFormatter.formatShortMessage(userId, event, position), false); } } } |