Add mail merge script with sample names and letter template
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
PLACEHOLDER = "[name]"
|
||||
|
||||
with open("Input/Names/invited_names.txt") as names_file:
|
||||
names = names_file.readlines()
|
||||
|
||||
with open("Input/Letters/starting_letter.txt") as letter_file:
|
||||
letter_contents = letter_file.read()
|
||||
|
||||
for name in names:
|
||||
stripped_name = name.strip()
|
||||
new_letter = letter_contents.replace(PLACEHOLDER, stripped_name)
|
||||
with open(f"Output/ReadyToSend/letter_for_{stripped_name}.txt", "w") as completed_letter:
|
||||
completed_letter.write(new_letter)
|
||||
Reference in New Issue
Block a user