aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification/NotificationMail.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-07 14:15:18 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-07 14:15:18 +0500
commit6c64c6e87a25b4d2339f2fd8d83fa4bc36d461f2 (patch)
treeed170c0dbdbc31a6625de6cd8fd4d74836711ba3 /src/org/traccar/notification/NotificationMail.java
parentc674d90bc41e1a4b03fcc1779e711f8d8b79bf90 (diff)
downloadtrackermap-server-6c64c6e87a25b4d2339f2fd8d83fa4bc36d461f2.tar.gz
trackermap-server-6c64c6e87a25b4d2339f2fd8d83fa4bc36d461f2.tar.bz2
trackermap-server-6c64c6e87a25b4d2339f2fd8d83fa4bc36d461f2.zip
Implement mail templates
Diffstat (limited to 'src/org/traccar/notification/NotificationMail.java')
-rw-r--r--src/org/traccar/notification/NotificationMail.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java
index 90f6bd75e..dc68b82e9 100644
--- a/src/org/traccar/notification/NotificationMail.java
+++ b/src/org/traccar/notification/NotificationMail.java
@@ -29,6 +29,7 @@ import org.traccar.helper.Log;
import org.traccar.model.Event;
import org.traccar.model.Position;
import org.traccar.model.User;
+import org.traccar.notification.NotificationFormatter.MailMessage;
public final class NotificationMail {
@@ -106,8 +107,9 @@ public final class NotificationMail {
}
message.addRecipient(Message.RecipientType.TO, new InternetAddress(user.getEmail()));
- message.setSubject(NotificationFormatter.formatTitle(userId, event, position));
- message.setText(NotificationFormatter.formatMessage(userId, event, position));
+ MailMessage mailMessage = NotificationFormatter.formatMessage(userId, event, position);
+ message.setSubject(mailMessage.getSubject());
+ message.setContent(mailMessage.getBody(), "text/html; charset=utf-8");
Transport transport = session.getTransport();
try {