You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2017/06/16 12:56:28 UTC

incubator-unomi git commit: UNOMI-99 Improve network unavailable and connection timeout handling - Fix send mail action to work even if we don't specify a notification type, id and frequency

Repository: incubator-unomi
Updated Branches:
  refs/heads/master 15ba3c9e3 -> b38d44c8d


UNOMI-99 Improve network unavailable and connection timeout handling
- Fix send mail action to work even if we don't specify a notification type, id and frequency

Signed-off-by: Serge Huber <sh...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/b38d44c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/b38d44c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/b38d44c8

Branch: refs/heads/master
Commit: b38d44c8d22f91e0956a4e3ff8b373d09ec519f4
Parents: 15ba3c9
Author: Serge Huber <sh...@apache.org>
Authored: Fri Jun 16 14:56:19 2017 +0200
Committer: Serge Huber <sh...@apache.org>
Committed: Fri Jun 16 14:56:19 2017 +0200

----------------------------------------------------------------------
 .../apache/unomi/plugins/mail/actions/SendMailAction.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b38d44c8/plugins/mail/src/main/java/org/apache/unomi/plugins/mail/actions/SendMailAction.java
----------------------------------------------------------------------
diff --git a/plugins/mail/src/main/java/org/apache/unomi/plugins/mail/actions/SendMailAction.java b/plugins/mail/src/main/java/org/apache/unomi/plugins/mail/actions/SendMailAction.java
index fc8b85a..8810bbc 100644
--- a/plugins/mail/src/main/java/org/apache/unomi/plugins/mail/actions/SendMailAction.java
+++ b/plugins/mail/src/main/java/org/apache/unomi/plugins/mail/actions/SendMailAction.java
@@ -82,6 +82,16 @@ public class SendMailAction implements ActionExecutor {
         String subject = (String) action.getParameterValues().get("subject");
         String template = (String) action.getParameterValues().get("template");
 
+        if (notifType == null) {
+            notifType = "default";
+        }
+        if (notifTypeId == null) {
+            notifTypeId = subject;
+        }
+        if (notifyOnce == null) {
+            notifyOnce = false;
+        }
+
         Map profileNotif = (HashMap) event.getProfile().getSystemProperties().get("notificationAck");
         if (profileNotif != null && profileNotif.get(notifType) != null && ((HashMap) profileNotif.get(notifType)).get(notifTypeId) != null) {
             Integer notifTypeAck = (Integer) ((HashMap) profileNotif.get(notifType) ).get(notifTypeId);