File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ from datetime import datetime
12import os
23from dotenv import load_dotenv
34import redmail
5051
5152email_body = intro + table_html + salutation
5253
54+ today = datetime .today ()
55+ is_weekday = today .weekday () < 5 # Monday=0, ..., Friday=4
56+ is_monday = today .weekday () == 0
57+
5358# This is here to emphasize the sender does not have to be the same as the receiver
54- email_receiver = gmail_address
59+ # and the receiver list can vary
60+ if is_weekday :
61+ if is_monday :
62+ email_receivers = [gmail_address , gmail_address , gmail_address ]
63+ else :
64+ email_receivers = [gmail_address , gmail_address ]
65+ else :
66+ email_receivers = [gmail_address ]
67+
5568
5669redmail .gmail .username = gmail_address
5770redmail .gmail .password = gmail_app_password
5871
5972redmail .gmail .send (
6073 subject = email_subject ,
61- receivers = [ "jules.walzergoldfeld@posit.co" ] ,
74+ receivers = email_receivers ,
6275 html = email_body ,
6376)
You can’t perform that action at this time.
0 commit comments