Add some SMS messages to the choose template page

This commit is contained in:
Chris Hill-Scott
2016-01-14 10:55:30 +00:00
parent fe0774066d
commit c7f635be4a
6 changed files with 57 additions and 25 deletions
+20
View File
@@ -0,0 +1,20 @@
sms_templates = [
{
'name': 'Reminder',
'body': """
Vehicle tax: Your vehicle tax for ((registration number)) expires on ((date)).
Tax your vehicle at www.gov.uk/vehicle-tax
"""
},
{
'name': 'Warning',
'body': """
Vehicle tax: Your vehicle tax for ((registration number)) has expired.
Tax your vehicle at www.gov.uk/vehicle-tax
"""
},
]
email_templates = [
]
+3 -19
View File
@@ -22,23 +22,7 @@ from app.main import main
from app.main.forms import CsvUploadForm
from app.main.uploader import s3upload
# TODO move this to the templates directory
message_templates = [
{
'name': 'Reminder',
'body': """
Vehicle tax: Your vehicle tax for ((registration number)) expires on ((date)).
Tax your vehicle at www.gov.uk/vehicle-tax
"""
},
{
'name': 'Warning',
'body': """
Vehicle tax: Your vehicle tax for ((registration number)) has expired.
Tax your vehicle at www.gov.uk/vehicle-tax
"""
},
]
from ._templates import sms_templates
@main.route("/services/<int:service_id>/sms/send", methods=['GET', 'POST'])
@@ -66,7 +50,7 @@ def sendsms(service_id):
return redirect(url_for('.sendsms', service_id=service_id))
return render_template('views/send-sms.html',
message_templates=message_templates,
message_templates=sms_templates,
form=form,
service_id=service_id)
@@ -88,7 +72,7 @@ def checksms(service_id):
'views/check-sms.html',
upload_result=upload_result,
filename=filename,
message_template=message_templates[0]['body'],
message_template=sms_templates[0]['body'],
service_id=service_id
)
elif request.method == 'POST':
+5 -1
View File
@@ -4,13 +4,17 @@ from flask_login import login_required
from app.main import main
from app.main.forms import TemplateForm
from ._templates import sms_templates, email_templates
@main.route("/services/<int:service_id>/templates")
@login_required
def manage_templates(service_id):
return render_template(
'views/manage-templates.html',
service_id=service_id
service_id=service_id,
sms_templates=sms_templates,
email_templates=email_templates
)