about summary refs log tree commit diff
path: root/web/panettone/src/panettone.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'web/panettone/src/panettone.lisp')
-rw-r--r--web/panettone/src/panettone.lisp17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp
index c97a988404fa..ba079df62b66 100644
--- a/web/panettone/src/panettone.lisp
+++ b/web/panettone/src/panettone.lisp
@@ -515,6 +515,23 @@
         :issue-id id
         :body body
         :author-dn (dn *user*))
+
+       ;; Send email notifications (in a thread, since smtp is slow)
+       (let ((current-user *user*))
+         (model:make-thread
+          (lambda ()
+            (let ((issue (model:get-issue id)))
+              (dolist (user-dn (remove-duplicates
+                                (cons (author-dn issue)
+                                      (model:issue-commenter-dns id))
+                                :test #'equal))
+                (when (not (equal (dn current-user) user-dn))
+                  (email:notify-user
+                   user-dn
+                   :subject (format nil "~A commented on \"~A\""
+                                    (displayname current-user)
+                                    (subject issue))
+                   :message body)))))))
        (redirect-to-issue)))))
 
 (defroute close-issue