From 6c64c6e87a25b4d2339f2fd8d83fa4bc36d461f2 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 7 Dec 2016 14:15:18 +0500 Subject: Implement mail templates --- templates/mail/alarm.vm | 10 ++++++++++ templates/mail/commandResult.vm | 9 +++++++++ templates/mail/deviceMoving.vm | 10 ++++++++++ templates/mail/deviceOffline.vm | 9 +++++++++ templates/mail/deviceOnline.vm | 9 +++++++++ templates/mail/deviceOverspeed.vm | 17 +++++++++++++++++ templates/mail/deviceStopped.vm | 10 ++++++++++ templates/mail/deviceUnknown.vm | 9 +++++++++ templates/mail/geofenceEnter.vm | 10 ++++++++++ templates/mail/geofenceExit.vm | 10 ++++++++++ templates/mail/ignitionOff.vm | 10 ++++++++++ templates/mail/ignitionOn.vm | 10 ++++++++++ templates/mail/maintenance.vm | 10 ++++++++++ templates/mail/unknown.vm | 7 +++++++ 14 files changed, 140 insertions(+) create mode 100644 templates/mail/alarm.vm create mode 100644 templates/mail/commandResult.vm create mode 100644 templates/mail/deviceMoving.vm create mode 100644 templates/mail/deviceOffline.vm create mode 100644 templates/mail/deviceOnline.vm create mode 100644 templates/mail/deviceOverspeed.vm create mode 100644 templates/mail/deviceStopped.vm create mode 100644 templates/mail/deviceUnknown.vm create mode 100644 templates/mail/geofenceEnter.vm create mode 100644 templates/mail/geofenceExit.vm create mode 100644 templates/mail/ignitionOff.vm create mode 100644 templates/mail/ignitionOn.vm create mode 100644 templates/mail/maintenance.vm create mode 100644 templates/mail/unknown.vm (limited to 'templates') diff --git a/templates/mail/alarm.vm b/templates/mail/alarm.vm new file mode 100644 index 000000000..57b6ba9be --- /dev/null +++ b/templates/mail/alarm.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: alarm!") + + + +Device: $device.name
+Alarm: $position.getString("alarm")
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/commandResult.vm b/templates/mail/commandResult.vm new file mode 100644 index 000000000..084152158 --- /dev/null +++ b/templates/mail/commandResult.vm @@ -0,0 +1,9 @@ +#set($subject = "$device.name: command result received") + + + +Device: $device.name
+Result: $position.getString("result")
+Time: $event.serverTime
+ + diff --git a/templates/mail/deviceMoving.vm b/templates/mail/deviceMoving.vm new file mode 100644 index 000000000..2a3c703b5 --- /dev/null +++ b/templates/mail/deviceMoving.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: moving") + + + +Device: $device.name
+Moving
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/deviceOffline.vm b/templates/mail/deviceOffline.vm new file mode 100644 index 000000000..a62133b71 --- /dev/null +++ b/templates/mail/deviceOffline.vm @@ -0,0 +1,9 @@ +#set($subject = "$device.name: offline") + + + +Device: $device.name
+Offline
+Time: $event.serverTime
+ + diff --git a/templates/mail/deviceOnline.vm b/templates/mail/deviceOnline.vm new file mode 100644 index 000000000..c38393062 --- /dev/null +++ b/templates/mail/deviceOnline.vm @@ -0,0 +1,9 @@ +#set($subject = "$device.name: online") + + + +Device: $device.name
+Online
+Time: $event.serverTime
+ + diff --git a/templates/mail/deviceOverspeed.vm b/templates/mail/deviceOverspeed.vm new file mode 100644 index 000000000..5f8c65096 --- /dev/null +++ b/templates/mail/deviceOverspeed.vm @@ -0,0 +1,17 @@ +#set($subject = "$device.name: exceeds the speed") +#if($speedUnits == 'kmh') +#set($speedString = $position.speed * 1.852 + ' km/h') +#elseif($speedUnits == 'mph') +#set($speedString = $position.speed * 1.15078 + ' mph') +#else +#set($speedString = "$position.speed kn") +#end + + + +Device: $device.name
+Exceeds the speed: $speedString
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/deviceStopped.vm b/templates/mail/deviceStopped.vm new file mode 100644 index 000000000..003ce2e13 --- /dev/null +++ b/templates/mail/deviceStopped.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: stopped") + + + +Device: $device.name
+Stopped
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/deviceUnknown.vm b/templates/mail/deviceUnknown.vm new file mode 100644 index 000000000..75203bdfc --- /dev/null +++ b/templates/mail/deviceUnknown.vm @@ -0,0 +1,9 @@ +#set($subject = "$device.name: status is unknown") + + + +Device: $device.name
+Status is unknown
+Time: $event.serverTime
+ + diff --git a/templates/mail/geofenceEnter.vm b/templates/mail/geofenceEnter.vm new file mode 100644 index 000000000..32ee153bc --- /dev/null +++ b/templates/mail/geofenceEnter.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: has entered geofence") + + + +Device: $device.name
+Has entered geofence: $geofence.name
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/geofenceExit.vm b/templates/mail/geofenceExit.vm new file mode 100644 index 000000000..b01653e49 --- /dev/null +++ b/templates/mail/geofenceExit.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: has exited geofence") + + + +Device: $device.name
+Has exited geofence: $geofence.name
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/ignitionOff.vm b/templates/mail/ignitionOff.vm new file mode 100644 index 000000000..b45ecfca1 --- /dev/null +++ b/templates/mail/ignitionOff.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: ignition OFF") + + + +Device: $device.name
+Ignition OFF
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/ignitionOn.vm b/templates/mail/ignitionOn.vm new file mode 100644 index 000000000..b2f1041bb --- /dev/null +++ b/templates/mail/ignitionOn.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: ignition ON") + + + +Device: $device.name
+Ignition ON
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/maintenance.vm b/templates/mail/maintenance.vm new file mode 100644 index 000000000..c7bc1a960 --- /dev/null +++ b/templates/mail/maintenance.vm @@ -0,0 +1,10 @@ +#set($subject = "$device.name: maintenance is required") + + + +Device: $device.name
+Maintenance is required
+Point: #if($position.address)$position.address#{else}$position.latitude°, $position.longitude°#end
+Time: $event.serverTime
+ + diff --git a/templates/mail/unknown.vm b/templates/mail/unknown.vm new file mode 100644 index 000000000..566ce0d42 --- /dev/null +++ b/templates/mail/unknown.vm @@ -0,0 +1,7 @@ +#set($subject = "Unknown type") + + + +Unknown type + + -- cgit v1.2.3