Loading main.py +10 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,16 @@ os.makedirs(MAILDIR, exist_ok=True) MAIL_TEMPLATE = "./src/assignment_mail.txt" def prepare_mail_content(giver, presentee): """Fills the template mail text with the respective attributes, most importantly the address of the presentee. Args: giver: deserialized JSON representation of the person making the gift presentee: deserialized JSON representation of the receiver of the gift Returns: str: the completed mail body """ with open(MAIL_TEMPLATE, "r") as f: text = f.read() text = text.replace("{giver_name}", giver["name"]) Loading Loading
main.py +10 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,16 @@ os.makedirs(MAILDIR, exist_ok=True) MAIL_TEMPLATE = "./src/assignment_mail.txt" def prepare_mail_content(giver, presentee): """Fills the template mail text with the respective attributes, most importantly the address of the presentee. Args: giver: deserialized JSON representation of the person making the gift presentee: deserialized JSON representation of the receiver of the gift Returns: str: the completed mail body """ with open(MAIL_TEMPLATE, "r") as f: text = f.read() text = text.replace("{giver_name}", giver["name"]) Loading