summaryrefslogtreecommitdiff
path: root/app/Event/CommentNotificationListener.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-08-15 17:23:41 -0700
committerFrédéric Guillot <fred@kanboard.net>2014-08-15 17:23:41 -0700
commit9eeded33f68872515954a2fc177fcb47a9273ae9 (patch)
treef3ef9507e087ca6bf3ce624232da240a8689b051 /app/Event/CommentNotificationListener.php
parentc539bdc8ab746c5afd48cf87de057dc38d50adac (diff)
Add email notifications
Diffstat (limited to 'app/Event/CommentNotificationListener.php')
-rw-r--r--app/Event/CommentNotificationListener.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/Event/CommentNotificationListener.php b/app/Event/CommentNotificationListener.php
new file mode 100644
index 00000000..3771ea7e
--- /dev/null
+++ b/app/Event/CommentNotificationListener.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Event;
+
+use Event\BaseNotificationListener;
+
+/**
+ * Comment notification listener
+ *
+ * @package event
+ * @author Frederic Guillot
+ */
+class CommentNotificationListener extends BaseNotificationListener
+{
+ /**
+ * Fetch data for the mail template
+ *
+ * @access public
+ * @param array $data Event data
+ * @return array
+ */
+ public function getTemplateData(array $data)
+ {
+ $values = array();
+ $values['comment'] = $this->notification->comment->getById($data['id']);
+ $values['task'] = $this->notification->task->getById($data['task_id'], true);
+
+ return $values;
+ }
+}