Nicely formatted email body.

This commit is contained in:
Dominik Pantůček 2023-04-11 09:03:40 +02:00
parent ac967be970
commit f2389c963d
3 changed files with 29 additions and 17 deletions

View file

@ -37,7 +37,7 @@ HACKERBASE-DEPS=hackerbase.scm month.import.scm \
cards.import.scm members-print.import.scm \ cards.import.scm members-print.import.scm \
members-payments.import.scm web-static.import.scm \ members-payments.import.scm web-static.import.scm \
environment.import.scm mailman.import.scm texts.import.scm \ environment.import.scm mailman.import.scm texts.import.scm \
tests.import.scm tests.import.scm reminders.import.scm
HACKERBASE-OBJS=hackerbase.o testing.o listing.o month.o period.o \ HACKERBASE-OBJS=hackerbase.o testing.o listing.o month.o period.o \
ansi.o util-dict-list.o command-line.o members-base.o \ ansi.o util-dict-list.o command-line.o members-base.o \
@ -317,7 +317,7 @@ util-mail.import.scm: $(UTIL-MAIL-SOURCES)
REMINDERS-SOURCES=reminders.scm member-record.import.scm \ REMINDERS-SOURCES=reminders.scm member-record.import.scm \
util-mail.import.scm util-dict-list.import.scm \ util-mail.import.scm util-dict-list.import.scm \
members-payments.import.scm util-format.scm members-payments.import.scm util-format.import.scm
reminders.o: reminders.import.scm reminders.o: reminders.import.scm
reminders.import.scm: $(REMINDERS-SOURCES) reminders.import.scm: $(REMINDERS-SOURCES)

View file

@ -42,20 +42,31 @@
;; Creates reminder email body ;; Creates reminder email body
(define (reminder-email-body mr) (define (reminder-email-body mr)
(list (let ((C identity)
(member-format "Ahoj ~N," mr) (M (lambda (s)
"podle evidence členů a bankovního účtu to vypadá, že máš nedoplatek" (member-format s mr)))
(format "ve výši ~A Kč." (format-amount (member-total-balance mr))) (F format)
"Zkontroluj, prosím, zda tvé platby členských příspěvků" (absdebt (format-amount (- (member-total-balance mr))))
(member-format "s variabilním symbolem ~I byly zaslány na" mr) (macc "2500079551/2010"))
"správný účet 1234/2010" (list
"" (M "Ahoj ~N,")
"" (C "podle evidence členů a bankovního účtu to vypadá, že máš nedoplatek")
(member-format "Hi ~N," mr) (F "ve výši ~A Kč." absdebt)
"" (C "Zkontroluj, prosím, zda tvé platby členských příspěvků")
"--" (M "s variabilním symbolem ~I byly zaslány na")
"Brmlab Hackerspace Members Database" (F "správný účet ~A." macc)
)) ""
""
(M "Dear ~N,")
(C "according to the members database and bank account statements, it appears")
(F "your payment of ~A CZK is missing." absdebt)
(C "Please, check whether your membership fees were transfered")
(M "correctly with the variable symbol (identification) ~I to")
(F "the correct bank account ~A." macc)
""
"--"
"Brmlab Hackerspace Members Database"
)))
;; Creates reminder email dictionary ;; Creates reminder email dictionary
(define (make-reminder-email mr) (define (make-reminder-email mr)

View file

@ -41,7 +41,8 @@
(let* ((str (number->string amt)) (let* ((str (number->string amt))
(flds (string-split str ".")) (flds (string-split str "."))
(integer? (null? (cdr flds)))) (integer? (null? (cdr flds))))
(if integer? (if (or integer?
(string=? (cadr flds) "0"))
(format "~A.--" (car flds)) (format "~A.--" (car flds))
(format "~A.~A" (format "~A.~A"
(car flds) (car flds)