aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-30 14:18:26 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-30 14:18:26 +0500
commitb6d9d992b3b5eaaa5c7fec33fd63e28480f05d97 (patch)
tree3ab2814893a6da8064955c012b56508bacd89ffa /src/org/traccar/api/resource
parent963adbba43d2849c968da85e51112f834b550f8d (diff)
downloadtrackermap-server-b6d9d992b3b5eaaa5c7fec33fd63e28480f05d97.tar.gz
trackermap-server-b6d9d992b3b5eaaa5c7fec33fd63e28480f05d97.tar.bz2
trackermap-server-b6d9d992b3b5eaaa5c7fec33fd63e28480f05d97.zip
Implement API to test mail
Diffstat (limited to 'src/org/traccar/api/resource')
-rw-r--r--src/org/traccar/api/resource/NotificationResource.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/NotificationResource.java b/src/org/traccar/api/resource/NotificationResource.java
index c43cca122..e89887e92 100644
--- a/src/org/traccar/api/resource/NotificationResource.java
+++ b/src/org/traccar/api/resource/NotificationResource.java
@@ -18,6 +18,7 @@ package org.traccar.api.resource;
import java.sql.SQLException;
import java.util.Collection;
+import javax.mail.MessagingException;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
@@ -29,7 +30,9 @@ import javax.ws.rs.core.Response;
import org.traccar.Context;
import org.traccar.api.BaseResource;
+import org.traccar.model.Event;
import org.traccar.model.Notification;
+import org.traccar.notification.NotificationMail;
@Path("users/notifications")
@Produces(MediaType.APPLICATION_JSON)
@@ -57,4 +60,11 @@ public class NotificationResource extends BaseResource {
return Response.ok(entity).build();
}
+ @Path("testmail")
+ @GET
+ public Response testMail() throws MessagingException {
+ NotificationMail.sendMailSync(getUserId(), new Event("unknown", 0), null);
+ return Response.noContent().build();
+ }
+
}