aboutsummaryrefslogtreecommitdiffstats
path: root/src/email.lisp
diff options
context:
space:
mode:
authorTeddy Wing2022-05-08 05:07:39 +0200
committerTeddy Wing2022-05-08 05:07:39 +0200
commit22461379250147870550d4d9cd43dc67f65892a9 (patch)
tree8c9a66ff3c071868b86c81528c896c1e196f2130 /src/email.lisp
parent8d98dd58afdbf659b6c246f158451cd8c850acb8 (diff)
downloadwajir-22461379250147870550d4d9cd43dc67f65892a9.tar.bz2
Start of email building
Take a recipient email address. Build an email containing the issue details. Change the `run` loop to only operate on a single issue for testing purposes.
Diffstat (limited to 'src/email.lisp')
-rw-r--r--src/email.lisp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/email.lisp b/src/email.lisp
new file mode 100644
index 0000000..c877eda
--- /dev/null
+++ b/src/email.lisp
@@ -0,0 +1,20 @@
+(in-package :wajir)
+
+(defun deliver-email (recipient issue)
+ (cl-smtp:write-rfc8822-message
+ *standard-output*
+ (format nil "wajir@~A" (uiop:hostname))
+ `(,recipient)
+ (format-subject issue)
+ (format-description issue)))
+
+(defun format-subject (issue)
+ (format nil
+ "[JIRA] (~A) ~A"
+ (gethash "key" issue)
+ (gethash "summary"
+ (gethash "fields" issue))))
+
+(defun format-description (issue)
+ (gethash "description"
+ (gethash "fields" issue)))