Personalising Spammy Marketing Emails
Description:
You are sending out a marketing campaign for your company, Code-o-matic. But you want to personalise the emails so that the people don't think they are being spammed!
You will be given a string of marketing text called campaign
and a hash person
.
In the string campaign
, there will be three personalisable elements
<NAME>
<CITY>
<FAVOURITE PRODUCTS>
.
You need to replace these elements with the personal details of the person to whom you are sending the email which are in the hash person
(which may contain other information from the database, which you don't need).
Examples:
You will be given this string called campaign
:
"Hello , how is the weather in today? We wanted to let you know that are on sale today only!"
You will be given this hash:
person = {:name => "Sally", :city => "Glasgow", :favourite_product => "toasters"}.
You should return this string:
"Hello Sally, how is the weather in Glasgow today? We wanted to let you know that toasters are on sale today only!"
Note that the hash keys do not exactly match the tags, but there is a one to one mapping between them.
~~~ if:ruby
| Tag | Key|
|----------|
| `<NAME>` | `:name`|
| `<CITY>` | `:city`|
| `<FAVOURITE PRODUCTS>` | `:favourite_product`|
~~~
~~~ if:javascript
| Tag | Key|
|----------|
| `<NAME>` | `name`|
| `<CITY>` | `city`|
| `<FAVOURITE PRODUCTS>` | `favourite_products`|
~~~
Similar Kata:
Stats:
Created | Sep 22, 2016 |
Published | Sep 22, 2016 |
Warriors Trained | 1155 |
Total Skips | 27 |
Total Code Submissions | 3293 |
Total Times Completed | 673 |
Ruby Completions | 118 |
JavaScript Completions | 567 |
Total Stars | 16 |
% of votes with a positive feedback rating | 85% of 200 |
Total "Very Satisfied" Votes | 152 |
Total "Somewhat Satisfied" Votes | 35 |
Total "Not Satisfied" Votes | 13 |
Total Rank Assessments | 34 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |