Add mail merge script with sample names and letter template
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Dear [name],
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,8 @@
|
||||
Aang
|
||||
Zuko
|
||||
Appa
|
||||
Katara
|
||||
Sokka
|
||||
Momo
|
||||
Uncle Iroh
|
||||
Toph
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Aang,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Appa,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Katara,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Momo,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Sokka,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Toph,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Uncle Iroh,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -0,0 +1,7 @@
|
||||
Dear Zuko,
|
||||
|
||||
You are invited to my birthday this Saturday.
|
||||
|
||||
Hope you can make it!
|
||||
|
||||
Angela
|
||||
@@ -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