Commit 8541ac61 authored by H. Fischer's avatar H. Fischer
Browse files

Add docstring for prepare_mail_content

parent bb62cd37
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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"])