Merge pull request #2827 from alphagov/depend-on-service-volumes

When going live, make reply-to address and text message sender dependent on estimated sending volumes
This commit is contained in:
Chris Hill-Scott
2019-03-08 13:56:49 +00:00
committed by GitHub
3 changed files with 73 additions and 27 deletions

View File

@@ -226,7 +226,7 @@ class Service():
@property
def needs_to_add_email_reply_to_address(self):
return self.has_email_templates and not self.has_email_reply_to_address
return self.volume_email and not self.has_email_reply_to_address
@property
def shouldnt_use_govuk_as_sms_sender(self):
@@ -269,7 +269,7 @@ class Service():
@property
def needs_to_change_sms_sender(self):
return all((
self.has_sms_templates,
self.volume_sms,
self.shouldnt_use_govuk_as_sms_sender,
self.sms_sender_is_govuk,
))

View File

@@ -27,14 +27,21 @@
'Add templates with examples of the content you plan to send',
url_for('main.choose_template', service_id=current_service.id),
) }}
{% if current_service.has_email_templates %}
{% if (
current_service.has_email_templates
and (current_service.volume_email != 0)
) %}
{{ task_list_item(
current_service.has_email_reply_to_address,
'Add an email reply-to address',
url_for('main.service_email_reply_to', service_id=current_service.id),
) }}
{% endif %}
{% if current_service.has_sms_templates and current_service.shouldnt_use_govuk_as_sms_sender %}
{% if (
current_service.has_sms_templates
and current_service.shouldnt_use_govuk_as_sms_sender
and (current_service.volume_sms != 0)
) %}
{{ task_list_item(
not current_service.sms_sender_is_govuk,
'Change your text message sender name',