Search⌘ K

Mail Merge Birthday Invitation Cards

Explore how to automate the creation of personalized birthday invitation cards using Ruby. Learn to perform text substitution in templates, read from and write to text files, and generate multiple customized documents efficiently with practical mail merge methods.

Problem

Jessica is planning to invite her friends to her 12th birthday party. Instead of writing individual invitations, she wants to print them out on cards. Rather than creating documents one by one, she wants to generate a letter document (a text file) using the template below:

Dear {{first_name}},
I am celebrating my 12th Birthday on the 1st of April!
Come celebrate with me!
Where: 42 Greed-Island Street, Yorkshin City
When: 2PM to 5PM
RSVP: 24th March (0400-000-000 or rsvpjessica@example.com)
Hope to see you there.
Jessica.
Email template for generating text files

The friends she wants to invite are:

Pokkle, Angela, Tonpa, Toby, Biscuit, Mito, Kate, Renee, Chloe, Kelly and Melody.
List containing her friends' first names

Write a program to help Jessica generate multiple invitation cards as text files such as pokkle_invitation.txt and  ...