From 3351f62e88e2ca4a87d3a3db0188421ec72123eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Mon, 10 Apr 2023 21:46:49 +0200 Subject: [PATCH] Link reminders module. --- src/Makefile | 8 +++++++- src/reminders.scm | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index c14dd6d..280bb1d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,7 +47,7 @@ HACKERBASE-OBJS=hackerbase.o testing.o listing.o month.o period.o \ member-parser.o web-static.o environment.o mailman.o \ util-set-list.o util-time.o util-tag.o util-io.o \ util-string.o util-io.o util-list.o util-parser.o texts.o \ - tests.o util-proc.o util-mail.o + tests.o util-proc.o util-mail.o reminders.o .PHONY: imports imports: $(HACKERBASE-DEPS) @@ -314,3 +314,9 @@ UTIL-MAIL-SOURCES=util-mail.scm util-io.import.scm util-mail.o: util-mail.import.scm util-mail.import.scm: $(UTIL-MAIL-SOURCES) + +REMINDERS-SOURCES=reminders.scm member-record.import.scm \ + util-mail.import.scm util-dict-list.import.scm + +reminders.o: reminders.import.scm +reminders.import.scm: $(REMINDERS-SOURCES) diff --git a/src/reminders.scm b/src/reminders.scm index 5bac991..f7e9968 100644 --- a/src/reminders.scm +++ b/src/reminders.scm @@ -50,7 +50,13 @@ ;; Prints email to the console (define (print-reminder-email em) - (print em)) + (print "### From: " (ldict-ref em 'from "-")) + (print "### To: " (ldict-ref em 'to)) + (print "### Subject: " (ldict-ref em 'subject)) + (let loop ((lines (ldict-ref em 'body))) + (when (not (null? lines)) + (print (car lines)) + (loop (cdr lines))))) ;; Creates and prints reminder email for given member record (define (make+print-reminder-email mr)