Ruby Problem
Create a template for an email letterhead with the followingvariables. The letter head will have format place holders for:
Company name
Street address
City, State and zip code
Telephone
Email
Web site URL
Use the array of data below to fill your template placeholders:
Run your finished script and capture the output to a file namedemail_template.txt.
# Two pieces of data in one array (multi dimensional array)contact_data = [ ['Company 1','123 Main Street', 'Anytown','Anystate', 88888,'444-444-4444','[email protected]','https://company1.com'], ['Company 2','77 Market Street', 'San Francisco','California', 94111,'415-444-4444','[email protected]','https://company2.com']]######### CREATE YOUR EMAIL TEMPLATE HERE #########email_template = \"\"# Process the data one array at a timecontact_data.each do |arr| # your code goes here.end
Your output should end up looking something like this:
Company 1 123 Main Street Anytown, Anystate 88888 Tel: 444-444-4444 Email: [email protected] URL: https://company1.com------------------------------ Company 2 77 Market Street San Francisco, California 94111 Tel: 415-444-4444 Email: [email protected] URL: https://company2.com------------------------------