diff options
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/api/resource/NotificationResource.java | 2 | ||||
-rw-r--r-- | src/org/traccar/notification/FullMessage.java (renamed from src/org/traccar/notification/MailMessage.java) | 4 | ||||
-rw-r--r-- | src/org/traccar/notification/NotificationFormatter.java | 4 | ||||
-rw-r--r-- | src/org/traccar/notification/NotificationMail.java | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/org/traccar/api/resource/NotificationResource.java b/src/org/traccar/api/resource/NotificationResource.java index bec1ce3ab..0d7a7982d 100644 --- a/src/org/traccar/api/resource/NotificationResource.java +++ b/src/org/traccar/api/resource/NotificationResource.java @@ -48,7 +48,7 @@ public class NotificationResource extends ExtendedObjectResource<Notification> { public Collection<Typed> get() { return Context.getNotificationManager().getAllNotificationTypes(); } - + @GET @Path("notificators") public Collection<Typed> getNotificators() { diff --git a/src/org/traccar/notification/MailMessage.java b/src/org/traccar/notification/FullMessage.java index 0fce43740..f66537c6e 100644 --- a/src/org/traccar/notification/MailMessage.java +++ b/src/org/traccar/notification/FullMessage.java @@ -16,12 +16,12 @@ */ package org.traccar.notification; -public class MailMessage { +public class FullMessage { private String subject; private String body; - public MailMessage(String subject, String body) { + public FullMessage(String subject, String body) { this.subject = subject; this.body = body; } diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java index ddc35227e..a1abdd0cc 100644 --- a/src/org/traccar/notification/NotificationFormatter.java +++ b/src/org/traccar/notification/NotificationFormatter.java @@ -88,12 +88,12 @@ public final class NotificationFormatter { return template; } - public static MailMessage formatFullMessage(long userId, Event event, Position position) { + public static FullMessage 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); + return new FullMessage((String) velocityContext.get("subject"), formattedMessage); } public static String formatShortMessage(long userId, Event event, Position position) { diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java index 76387c73b..808acca76 100644 --- a/src/org/traccar/notification/NotificationMail.java +++ b/src/org/traccar/notification/NotificationMail.java @@ -108,10 +108,10 @@ public final class NotificationMail extends Notificator { } message.addRecipient(Message.RecipientType.TO, new InternetAddress(user.getEmail())); - MailMessage mailMessage = NotificationFormatter.formatFullMessage(userId, event, position); - message.setSubject(mailMessage.getSubject()); + FullMessage fullMessage = NotificationFormatter.formatFullMessage(userId, event, position); + message.setSubject(fullMessage.getSubject()); message.setSentDate(new Date()); - message.setContent(mailMessage.getBody(), "text/html; charset=utf-8"); + message.setContent(fullMessage.getBody(), "text/html; charset=utf-8"); Transport transport = session.getTransport(); try { |