mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 23:08:25 -04:00
Merge pull request #3519 from alphagov/broadcast-settings
Remove emails, text messages and letter permissions from broadcast services
This commit is contained in:
@@ -47,215 +47,220 @@
|
||||
{% endcall %}
|
||||
{% endcall %}
|
||||
|
||||
{% call mapping_table(
|
||||
caption='Email settings',
|
||||
field_headings=['Label', 'Value', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=True
|
||||
) %}
|
||||
{% if not current_service.has_permission('broadcast') %}
|
||||
|
||||
{% call mapping_table(
|
||||
caption='Email settings',
|
||||
field_headings=['Label', 'Value', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=True
|
||||
) %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Send emails') }}
|
||||
{{ boolean_field('email' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
'.service_set_channel',
|
||||
channel='email',
|
||||
service_id=current_service.id
|
||||
),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='email') %}
|
||||
{{ text_field('Reply-to email addresses') }}
|
||||
{% call field(status='default' if current_service.count_email_reply_to_addresses == 0 else '') %}
|
||||
{{ current_service.default_email_reply_to_address or 'Not set' }}
|
||||
{% if current_service.count_email_reply_to_addresses > 1 %}
|
||||
<div class="hint">
|
||||
{{ '…and %d more' | format(current_service.count_email_reply_to_addresses - 1) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_email_reply_to',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='email') %}
|
||||
{{ text_field('Email branding') }}
|
||||
{{ text_field(current_service.email_branding_name) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.branding_request', service_id=current_service.id, branding_type="email"),
|
||||
permissions=['manage_service'],
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='email') %}
|
||||
{{ text_field('Send files by email') }}
|
||||
{{ text_field(current_service.contact_link if current_service.contact_link else "Not set up", truncate=true) }}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.send_files_by_email_contact_details', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Send emails') }}
|
||||
{{ boolean_field('email' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
'.service_set_channel',
|
||||
channel='email',
|
||||
service_id=current_service.id
|
||||
),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='email') %}
|
||||
{{ text_field('Reply-to email addresses') }}
|
||||
{% call field(status='default' if current_service.count_email_reply_to_addresses == 0 else '') %}
|
||||
{{ current_service.default_email_reply_to_address or 'Not set' }}
|
||||
{% if current_service.count_email_reply_to_addresses > 1 %}
|
||||
<div class="hint">
|
||||
{{ '…and %d more' | format(current_service.count_email_reply_to_addresses - 1) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% call mapping_table(
|
||||
caption='Text message settings',
|
||||
field_headings=['Label', 'Value', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=True
|
||||
) %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Send text messages') }}
|
||||
{{ boolean_field('sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
'.service_set_channel',
|
||||
service_id=current_service.id,
|
||||
channel='sms'
|
||||
),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_email_reply_to',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Text message senders') }}
|
||||
{% call field(status='default' if current_service.default_sms_sender == "None" else '') %}
|
||||
{{ current_service.default_sms_sender | nl2br if current_service.default_sms_sender else 'None'}}
|
||||
{% if current_service.count_sms_senders > 1 %}
|
||||
<div class="hint">
|
||||
{{ '…and %d more' | format(current_service.count_sms_senders - 1) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_sms_senders',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='email') %}
|
||||
{{ text_field('Email branding') }}
|
||||
{{ text_field(current_service.email_branding_name) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.branding_request', service_id=current_service.id, branding_type="email"),
|
||||
permissions=['manage_service'],
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='email') %}
|
||||
{{ text_field('Send files by email') }}
|
||||
{{ text_field(current_service.contact_link if current_service.contact_link else "Not set up", truncate=true) }}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.send_files_by_email_contact_details', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
{% call mapping_table(
|
||||
caption='Text message settings',
|
||||
field_headings=['Label', 'Value', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=True
|
||||
) %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Send text messages') }}
|
||||
{{ boolean_field('sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
'.service_set_channel',
|
||||
service_id=current_service.id,
|
||||
channel='sms'
|
||||
),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Text message senders') }}
|
||||
{% call field(status='default' if current_service.default_sms_sender == "None" else '') %}
|
||||
{{ current_service.default_sms_sender | nl2br if current_service.default_sms_sender else 'None'}}
|
||||
{% if current_service.count_sms_senders > 1 %}
|
||||
<div class="hint">
|
||||
{{ '…and %d more' | format(current_service.count_sms_senders - 1) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
}}
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_sms_senders',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Start text messages with service name') }}
|
||||
{{ boolean_field(current_service.prefix_sms) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_sms_prefix',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Send international text messages') }}
|
||||
{{ boolean_field('international_sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_international_sms',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Receive text messages') }}
|
||||
{{ boolean_field('inbound_sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_inbound_sms',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
{% call mapping_table(
|
||||
caption='Letter settings',
|
||||
field_headings=['Label', 'Value', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=True
|
||||
) %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Send letters') }}
|
||||
{{ boolean_field('letter' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
'.service_set_channel',
|
||||
channel='letter',
|
||||
service_id=current_service.id
|
||||
),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='letter') %}
|
||||
{{ text_field('Sender addresses') }}
|
||||
{% call field(status='' if current_service.count_letter_contact_details else 'default') %}
|
||||
{% if current_service.default_letter_contact_block %}
|
||||
{{ current_service.default_letter_contact_block_html }}
|
||||
{% elif current_service.count_letter_contact_details %}
|
||||
Blank
|
||||
{% else %}
|
||||
Not set
|
||||
{% endif %}
|
||||
{% if current_service.count_letter_contact_details > 1 %}
|
||||
<div class="hint">
|
||||
{{ '…and %d more' | format(current_service.count_letter_contact_details - 1) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Start text messages with service name') }}
|
||||
{{ boolean_field(current_service.prefix_sms) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_sms_prefix',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_letter_contact_details',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
)
|
||||
}}
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Send international text messages') }}
|
||||
{{ boolean_field('international_sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_international_sms',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='sms') %}
|
||||
{{ text_field('Receive text messages') }}
|
||||
{{ boolean_field('inbound_sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_inbound_sms',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='letter') %}
|
||||
{{ text_field('Letter branding') }}
|
||||
{{ optional_text_field(current_service.letter_branding.name) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.branding_request', service_id=current_service.id, branding_type="letter"),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
{% call mapping_table(
|
||||
caption='Letter settings',
|
||||
field_headings=['Label', 'Value', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=True
|
||||
) %}
|
||||
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Send letters') }}
|
||||
{{ boolean_field('letter' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
'.service_set_channel',
|
||||
channel='letter',
|
||||
service_id=current_service.id
|
||||
),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='letter') %}
|
||||
{{ text_field('Sender addresses') }}
|
||||
{% call field(status='' if current_service.count_letter_contact_details else 'default') %}
|
||||
{% if current_service.default_letter_contact_block %}
|
||||
{{ current_service.default_letter_contact_block_html }}
|
||||
{% elif current_service.count_letter_contact_details %}
|
||||
Blank
|
||||
{% else %}
|
||||
Not set
|
||||
{% endif %}
|
||||
{% if current_service.count_letter_contact_details > 1 %}
|
||||
<div class="hint">
|
||||
{{ '…and %d more' | format(current_service.count_letter_contact_details - 1) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_letter_contact_details',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% call settings_row(if_has_permission='letter') %}
|
||||
{{ text_field('Letter branding') }}
|
||||
{{ optional_text_field(current_service.letter_branding.name) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.branding_request', service_id=current_service.id, branding_type="letter"),
|
||||
permissions=['manage_service']
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if current_service.trial_mode %}
|
||||
<h2 class="heading-medium top-gutter-0">Your service is in trial mode</h2>
|
||||
|
||||
<p class="govuk-body">You can only:</p>
|
||||
{% if not current_service.has_permission('broadcast') %}
|
||||
<p class="govuk-body">You can only:</p>
|
||||
|
||||
<ul class='list list-bullet'>
|
||||
<li>send {{ current_service.message_limit }} text messages and emails per day</li>
|
||||
<li>send messages to yourself and other people in your team</li>
|
||||
<li>create letter templates, but not send them</li>
|
||||
</ul>
|
||||
<ul class='list list-bullet'>
|
||||
<li>send {{ current_service.message_limit }} text messages and emails per day</li>
|
||||
<li>send messages to yourself and other people in your team</li>
|
||||
<li>create letter templates, but not send them</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<p class="govuk-body">
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
@@ -269,11 +274,13 @@
|
||||
{% else %}
|
||||
<h2 class="heading-medium top-gutter-0">Your service is live</h2>
|
||||
|
||||
<p class="govuk-body">
|
||||
You can send up to
|
||||
{{ "{:,}".format(current_service.message_limit) }} messages
|
||||
per day.
|
||||
</p>
|
||||
{% if not current_service.has_permission('broadcast') %}
|
||||
<p class="govuk-body">
|
||||
You can send up to
|
||||
{{ "{:,}".format(current_service.message_limit) }} messages
|
||||
per day.
|
||||
</p>
|
||||
{% endif %}
|
||||
<p class="govuk-body">
|
||||
Problems or comments?
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.support') }}">Give feedback</a>.
|
||||
|
||||
Reference in New Issue
Block a user