Replace placeholders before sending a message

This commit replaces placeholders in a template with the user’s data, using
the Template class from utils
(https://github.com/alphagov/notifications-utils/tree/master/utils#template)

It also extracts the personalisation data from the CSV, taking account of the
different column headings that SMS and email CSVs will have.

At the point of creating the task to send an individual messages, validation of
the placeholders matching the template is assumed to have been done either:
- in processing the CSV in the admin app
- in the endpoint for the API call

No exceptions should be raised at this point.
This commit is contained in:
Chris Hill-Scott
2016-02-29 14:43:44 +00:00
parent 68eaacaafb
commit d6f7c7d1c9
10 changed files with 51 additions and 33 deletions

View File

@@ -1,2 +1,2 @@
to
+441234123123
phone number
+441234123123
1 to phone number
2 +441234123123 +441234123123