Make from email address configurable on command-line.

This commit is contained in:
Dominik Pantůček 2023-04-12 20:08:03 +02:00
parent b1226fd12c
commit 8e188a0a8c
2 changed files with 7 additions and 0 deletions

View file

@ -107,6 +107,8 @@
(-quiet () "Suppress all output"
(-quiet- #t)
(*progress-quiet* #t))
(-from (email) "Sender email address"
(*reminder-from* email))
""
"Query options:"
(-mi (id) "Specify member by id" (-member-id- (string->number id)))

View file

@ -28,6 +28,7 @@
(module
reminders
(
*reminder-from*
make+print-reminder-email
make+send-reminder-email
)
@ -42,6 +43,9 @@
util-format
brmember-format)
;; From address
(define *reminder-from* (make-parameter "Brmlab - Rada <rada@brmlab.cz>"))
;; Creates reminder email body
(define (reminder-email-body mr)
(let ((C identity)
@ -97,6 +101,7 @@
(let ((em (make-reminder-email mr)))
(print "Sending " (ldict-ref em 'subject) " originally to " (ldict-ref em 'to))
(send-mail (ldict-ref em 'body)
#:from (*reminder-from*)
#:to "joe@joe.cz"
#:subject (ldict-ref em 'subject))))