aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.example.ini14
-rwxr-xr-xsendmail.py12
2 files changed, 17 insertions, 9 deletions
diff --git a/config.example.ini b/config.example.ini
index 79a92dd..1d0e947 100644
--- a/config.example.ini
+++ b/config.example.ini
@@ -45,13 +45,13 @@ address = sj-calendar@ykpaoschool.cn
[sendmail]
# NOTE: All %'s must be duplicated due to the file format's limitations
-subject_format = Daily Bulletin %%
+subject_format = Daily Bulletin %%s
subject_date_format = %%Y-%%m-%%d
to_1 = s22537@stu.ykpaoschool.cn
-cc_1 =
-bcc_1 =
-to_2 = s22505@stu.ykpaoschool.cn
-cc_2 =
-bcc_2 =
+cc_1 = cora.chen@ykpaoschool.cn
+bcc_1_file = l1.txt
+to_2 = s22537@stu.ykpaoschool.cn
+cc_2 = duncan.weller@ykpaoschool.cn
+bcc_2_file = l2.txt
hour = 6
-minute = 30
+minute = 00
diff --git a/sendmail.py b/sendmail.py
index 0c7b1f8..d4b2a5c 100755
--- a/sendmail.py
+++ b/sendmail.py
@@ -210,7 +210,11 @@ def main() -> None:
body=html,
to=config["sendmail"]["to_1"].split(" "),
cc=config["sendmail"]["cc_1"].split(" "),
- bcc=config["sendmail"]["bcc_1"].split(" "),
+ bcc=[
+ w.strip()
+ for w in open(config["sendmail"]["bcc_1_file"], "r").readlines()
+ if w.strip()
+ ],
when=date.replace(
hour=int(config["sendmail"]["hour"]),
minute=int(config["sendmail"]["minute"]),
@@ -233,7 +237,11 @@ def main() -> None:
body=html,
to=config["sendmail"]["to_2"].split(" "),
cc=config["sendmail"]["cc_2"].split(" "),
- bcc=config["sendmail"]["bcc_2"].split(" "),
+ bcc=[
+ w.strip()
+ for w in open(config["sendmail"]["bcc_2_file"], "r").readlines()
+ if w.strip()
+ ],
when=date.replace(
hour=int(config["sendmail"]["hour"]),
minute=int(config["sendmail"]["minute"]),