about summary refs log tree commit diff
path: root/web/panettone
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-04-03T18·46-0400
committerglittershark <grfn@gws.fyi>2021-04-04T14·17+0000
commit808448682cda43fa9375b27bf25d62ec36311474 (patch)
tree768bc122e8bb18d8345aaf27365eaa40a1a40801 /web/panettone
parent6c78cb69c77113545361dcbcad40fe136d982ae5 (diff)
feat(panettone): Add some more info to emails r/2431
Add a little bit more information to issue notification emails,
including the IDs of issues and links to the issues themselves.

Change-Id: Ia54209f936a37c6dbdb60ebff5bb8c1034cffc9a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2809
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'web/panettone')
-rw-r--r--web/panettone/src/panettone.lisp34
1 files changed, 22 insertions, 12 deletions
diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp
index 1067f48339..10d501d8ae 100644
--- a/web/panettone/src/panettone.lisp
+++ b/web/panettone/src/panettone.lisp
@@ -423,6 +423,9 @@ given subject an body (in a thread, to avoid blocking)"
             :subject subject
             :message message)))))))
 
+(defun link-to-issue (issue-id)
+  (format nil "https://b.tvl.fyi/issues/~A" issue-id))
+
 (defun @auth-optional (next)
   (let ((*user* (hunchentoot:session-value 'user)))
     (funcall next)))
@@ -567,10 +570,13 @@ given subject an body (in a thread, to avoid blocking)"
        (let ((issue (model:get-issue id)))
          (send-email-for-issue
           id
-          :subject (format nil "~A commented on \"~A\""
+          :subject (format nil "~A commented on b/~A: \"~A\""
                            (displayname *user*)
+                           id
                            (subject issue))
-          :message body))
+          :message (format nil "~A~%~%~A"
+                           body
+                           (link-to-issue id))))
        (redirect-to-issue)))))
 
 (defroute close-issue
@@ -581,18 +587,20 @@ given subject an body (in a thread, to avoid blocking)"
   (let ((issue (model:get-issue id)))
     (send-irc-notification
      (format nil
-             "b/~A: \"~A\" closed by ~A - https://b.tvl.fyi/issues/~A"
+             "b/~A: \"~A\" closed by ~A - ~A"
              id
              (subject issue)
              (irc:noping (cn *user*))
-             id)
+             (link-to-issue id))
      :channel (or (uiop:getenvp "ISSUECHANNEL")
                   "##tvl-dev"))
     (send-email-for-issue
      id
-     :subject (format nil "~A closed \"~A\""
-                      (dn *user*)
-                      (subject issue))))
+     :subject (format nil "b/~A: \"~A\" closed by ~A"
+                      id
+                      (subject issue)
+                      (dn *user*))
+     :message (link-to-issue id)))
   (hunchentoot:redirect (format nil "/issues/~A" id)))
 
 (defroute open-issue
@@ -603,18 +611,20 @@ given subject an body (in a thread, to avoid blocking)"
   (let ((issue (model:get-issue id)))
     (send-irc-notification
      (format nil
-             "b/~A: \"~A\" reopened by ~A - https://b.tvl.fyi/issues/~A"
+             "b/~A: \"~A\" reopened by ~A - ~A"
              id
              (subject issue)
              (irc:noping (cn *user*))
-             id)
+             (link-to-issue id))
      :channel (or (uiop:getenvp "ISSUECHANNEL")
                   "##tvl-dev"))
     (send-email-for-issue
      id
-     :subject (format nil "~A reopened \"~A\""
-                      (dn *user*)
-                      (subject issue))))
+     :subject (format nil "b/~A: \"~A\" reopened by ~A"
+                      id
+                      (subject issue)
+                      (dn *user*))
+     :message (link-to-issue id)))
   (hunchentoot:redirect (format nil "/issues/~A" id)))
 
 (defroute styles ("/main.css") ()