diff --git a/app/main/forms.py b/app/main/forms.py index c85d58b6e..f4c2f6a39 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -346,9 +346,26 @@ class Feedback(Form): class RequestToGoLiveForm(Form): - usage = TextAreaField( - '', - validators=[DataRequired(message="Can’t be empty")] + channel = StringField( + 'Are you sending emails or text messages or both?', + validators=[DataRequired(message='Can’t be empty')] + ) + start_date = StringField( + 'When will you be ready to start sending messages?', + validators=[DataRequired(message='Can’t be empty')] + ) + start_volume = StringField( + 'How many messages do you expect to send per month to start with? Give an estimate in numbers.', + validators=[DataRequired(message='Can’t be empty')] + ) + peak_volume = StringField( + 'Will the number of messages a month increase and when will that start? Give an estimate.', + validators=[DataRequired(message='Can’t be empty')] + ) + upload_or_api = StringField( + 'Are you uploading a list of contacts that you’re sending your message to, ' + + 'or are you integrating your system with ours?', + validators=[DataRequired(message='Can’t be empty')] ) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 3f90d2bdf..71a038bed 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -110,10 +110,19 @@ def service_request_to_go_live(service_id): 'department_id': current_app.config.get('DESKPRO_DEPT_ID'), 'agent_team_id': current_app.config.get('DESKPRO_ASSIGNED_AGENT_TEAM_ID'), 'subject': 'Request to go live', - 'message': "On behalf of {} ({})\n\nUsage estimate\n---\n\n{}".format( + 'message': ( + 'On behalf of {} ({})\n\nExpected usage\n---' + '\nChannel: {}\nStart date: {}\nStart volume: {}' + '\nPeak volume: {}\nUpload or API: {}' + ).format( current_service['name'], url_for('main.service_dashboard', service_id=current_service['id'], _external=True), - form.usage.data + form.channel.data, + form.start_date.data, + form.start_volume.data, + form.peak_volume.data, + form.upload_or_api.data + ) } headers = { diff --git a/app/templates/views/service-settings/request-to-go-live.html b/app/templates/views/service-settings/request-to-go-live.html index ae5124491..57ac237d9 100644 --- a/app/templates/views/service-settings/request-to-go-live.html +++ b/app/templates/views/service-settings/request-to-go-live.html @@ -1,6 +1,7 @@ {% extends "withnav_template.html" %} {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} +{% from "components/banner.html" import banner_wrapper %} {% block page_title %} Request to go live – GOV.UK Notify @@ -10,49 +11,46 @@

Request to go live

+ {% call banner_wrapper(type='warning') %} +

You must accept the GOV.UK Notify data sharing and financial agreement (Memorandum of Understanding) before we can process data for you.

+ +

+ Contact the Notify team to get a copy of the agreement or to find out if your organisation has already accepted it. +

+ {% endcall %} +

- You’ll need to: + Before you request to go live, make you you’ve:

- - {{ textbox( - form.usage, - label='Estimate how many emails and text messages you’ll send each month', - hint='If your estimate is likely to change, tell us how ', - width='1-1', - rows=5 - ) }} + {{ textbox(form.channel, width='1-1') }} + {{ textbox(form.start_date, width='1-1') }} + {{ textbox(form.start_volume, width='1-1') }} + {{ textbox(form.peak_volume, width='1-1') }} + {{ textbox(form.upload_or_api, width='1-1') }}

- We will: + Once you’ve completed the tasks needed to set up, we’ll make your service live. We’ll do this within one working day. +

+

+ By requesting to go live you are agreeing to our terms of use.

- {{ page_footer('Request to go live') }}
diff --git a/app/templates/views/terms-of-use.html b/app/templates/views/terms-of-use.html index 0ca9c17db..29e9c6282 100644 --- a/app/templates/views/terms-of-use.html +++ b/app/templates/views/terms-of-use.html @@ -1,4 +1,5 @@ {% extends "withoutnav_template.html" %} +{% from "components/banner.html" import banner_wrapper %} {% block page_title %} Terms of use – GOV.UK Notify @@ -13,6 +14,15 @@ Terms of use – GOV.UK Notify Terms of use + {% call banner_wrapper(type='warning') %} +

You must accept the GOV.UK Notify data sharing and financial agreement (Memorandum of Understanding) before we can process data for you.

+ +

+ Contact the Notify team to get a copy of the agreement or to find out if your organisation has already accepted it. +

+ + {% endcall %} +

To accept these terms, you must be the service manager for your service. If you’re not the service manager, you’ll need to invite them.

@@ -152,7 +162,7 @@ Terms of use – GOV.UK Notify

When you send messages through GOV.UK Notify, we provide feedback on the status of every text message, email and letter.

You agree to use our delivery data to check (and potentially remove) bounced email addresses, mobile numbers and postal addresses from your database.

- +

You agree to ensure your user’s personal data is kept accurate and up to date, in line with Data Protection Act principles.

If you have consistently high bounce rates, we will investigate and may refuse to accept further messages for delivery. This is to protect delivery rates for other services using GOV.UK Notify.

@@ -181,7 +191,7 @@ Terms of use – GOV.UK Notify

You must estimate how many text messages, emails and letters you plan to send each year, including any spikes or seasonal variation.

We will make sure GOV.UK Notify is easily able to handle your estimated sending volume.

- +

We’ll check your templates before you can go live

@@ -195,7 +205,7 @@ Terms of use – GOV.UK Notify

You can remove your service from GOV.UK Notify at any time. Contact us and we’ll delete your account.

- +

Any data that you have processed through GOV.UK Notify will be deleted as part of the existing data deletion processes.

diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 0f75d86c6..cb26e0a9b 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -313,7 +313,13 @@ def test_should_redirect_after_request_to_go_live( client.login(api_user_active) response = client.post( url_for('main.service_request_to_go_live', service_id='6ce466d0-fd6a-11e5-82f5-e0accb9d11a6'), - data={'usage': "One million messages"}, + data={ + 'channel': 'Email', + 'start_date': '01/01/2017', + 'start_volume': '100,000', + 'peak_volume': '2,000,000', + 'upload_or_api': 'api' + }, follow_redirects=True ) assert response.status_code == 200 @@ -323,13 +329,20 @@ def test_should_redirect_after_request_to_go_live( 'subject': 'Request to go live', 'department_id': ANY, 'agent_team_id': ANY, - 'message': 'On behalf of Test Service (http://localhost/services/6ce466d0-fd6a-11e5-82f5-e0accb9d11a6/dashboard)\n\nUsage estimate\n---\n\nOne million messages', # noqa + 'message': ANY, 'person_name': api_user_active.name, 'person_email': api_user_active.email_address }, headers=ANY ) + returned_message = mock_post.call_args[1]['data']['message'] + assert 'Email' in returned_message + assert '01/01/2017' in returned_message + assert '100,000' in returned_message + assert '2,000,000' in returned_message + assert 'api' in returned_message + page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') flash_banner = page.find('div', class_='banner-default').string.strip() h1 = page.find('h1').string.strip() @@ -362,7 +375,13 @@ def test_log_error_on_request_to_go_live( with pytest.raises(InternalServerError): resp = client.post( url_for('main.service_request_to_go_live', service_id='6ce466d0-fd6a-11e5-82f5-e0accb9d11a6'), - data={'usage': 'blah'} + data={ + 'channel': 'channel', + 'start_date': 'start_date', + 'start_volume': 'start_volume', + 'peak_volume': 'peak_volume', + 'upload_or_api': 'upload_or_api' + } ) mock_logger.assert_called_with( "Deskpro create ticket request failed with {} '{}'".format(mock_post().status_code, mock_post().json())