From 808448682cda43fa9375b27bf25d62ec36311474 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 3 Apr 2021 14:46:50 -0400 Subject: feat(panettone): Add some more info to emails 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 Reviewed-by: tazjin --- web/panettone/src/panettone.lisp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'web/panettone') diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp index 1067f483397b..10d501d8aea9 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") () -- cgit 1.4.1