mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Make send the send flow generic
This commit parameterises all methods in the send view so that they can send either emails or SMS messages. It works out what kind of message it is sending from the `template_type` property of the template object. This means that the `Template` util class needs to know about these properties, which means that this commit depends on: https://github.com/alphagov/notifications-utils/pull/2 This commit does _not_ add tests for sending emails. The existing tests for sending SMS still pass, but actually sending emails is outside the scope of this story.
This commit is contained in:
@@ -31,7 +31,7 @@ def add_service_template(service_id, template_type):
|
||||
|
||||
if form.validate_on_submit():
|
||||
tdao.insert_service_template(
|
||||
form.name.data, form.template_content.data, service_id, form.subject.data or None
|
||||
form.name.data, template['template_type'], form.template_content.data, service_id, form.subject.data or None
|
||||
)
|
||||
return redirect(
|
||||
url_for('.choose_template', service_id=service_id, template_type=template_type)
|
||||
@@ -54,8 +54,9 @@ def edit_service_template(service_id, template_id):
|
||||
|
||||
if form.validate_on_submit():
|
||||
tdao.update_service_template(
|
||||
template_id, form.name.data,
|
||||
form.template_content.data, service_id)
|
||||
template_id, form.name.data, template['template_type'],
|
||||
form.template_content.data, service_id
|
||||
)
|
||||
return redirect(url_for(
|
||||
'.choose_template',
|
||||
service_id=service_id,
|
||||
|
||||
Reference in New Issue
Block a user