From 349b98ccc841587aadc6a2de5684f093cd72d628 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 3 Apr 2021 13:05:06 -0400 Subject: feat(panettone): Add functions to send email notifications Add a new package to panettone, :panettone.email with functions to send email notifications to users through the SMTP relay on whitby, respecting the value of `enable_email_notifications` on the user_settings table. Change-Id: Ia4ec65965abda06f1fadb178143d66bb8eae6482 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2804 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: tazjin --- web/panettone/src/packages.lisp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'web/panettone/src/packages.lisp') diff --git a/web/panettone/src/packages.lisp b/web/panettone/src/packages.lisp index 3bdb553b70..22a2a8649a 100644 --- a/web/panettone/src/packages.lisp +++ b/web/panettone/src/packages.lisp @@ -48,6 +48,19 @@ :issue-comments :num-comments :create-issue-comment)) +(defpackage panettone.email + (:nicknames :email) + (:use :cl) + (:import-from :alexandria :when-let) + (:import-from :panettone.model + :settings-for-user :enable-email-notifications-p) + (:import-from :panettone.authentication + :find-user-by-dn :mail :displayname) + (:export + :*smtp-server* :*smtp-server-port* :*notification-from* + :*notification-from-display-name* :*notification-subject-prefix* + :notify-user :send-email-notification)) + (defpackage panettone (:use :cl :klatre :easy-routes :iterate :panettone.util -- cgit 1.4.1