PLACEHOLDER = "[name]"

with open("Input/Names/invited_names.txt") as names_file:
    name = names_file.readlines()
    print(name)

with open("Input/Letters/starting_letter.txt") as letter_file:
    letter_contents = letter_file.read()
    for name in name:
        stripped_name = name.strip()
        new_letter = letter_contents.replace(PLACEHOLDER, stripped_name)
        with open(f"Output/ReadyToSend/letter_for_{stripped_name}.txt", mode="w") as complited_letter:
            complited_letter.write(new_letter)
