Skip to content

Commit c12334a

Browse files
committed
feat: O14 -> O15a Let recipients reply to your emails
feat: O15a -> O18 - Refactored existing email_reply_to.html to include new content - Added an "I'll do this later" link which directs user to "add recipients" - Backlinks for both O15a and O18
1 parent 9301149 commit c12334a

File tree

4 files changed

+47
-14
lines changed

4 files changed

+47
-14
lines changed

app/main/forms.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,21 @@ def get_placeholder_form_instance(
23752375
return PlaceholderForm(placeholder_value=dict_to_populate_from.get(placeholder_name, ""))
23762376

23772377

2378+
class AddRecipientForm(StripWhitespaceForm):
2379+
ADD_RECIPIENT_CHOICES = [
2380+
("upload_csv", "Upload a list of email addresses"),
2381+
("enter_single", "Enter a single email address"),
2382+
("use_my_email", "Use my email address"),
2383+
]
2384+
2385+
add_recipient_method = GovukRadiosField(
2386+
"",
2387+
choices=ADD_RECIPIENT_CHOICES,
2388+
thing="how to add recipients",
2389+
validators=[DataRequired()],
2390+
)
2391+
2392+
23782393
class SetSenderForm(StripWhitespaceForm):
23792394
def __init__(self, *args, **kwargs):
23802395
super().__init__(*args, **kwargs)

app/main/views/service_settings/index.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,26 @@ def service_email_reply_to(service_id):
405405
back="set_sender",
406406
template_id=template_id,
407407
)
408-
return render_template("views/service-settings/email_reply_to.html", alternative_backlink=backlink)
408+
409+
return render_template(
410+
"views/service-settings/email_reply_to.html",
411+
alternative_backlink=backlink,
412+
template_id=template_id,
413+
service_id=current_service.id,
414+
)
409415

410416

411417
@main.route("/services/<uuid:service_id>/service-settings/email-reply-to/add", methods=["GET", "POST"])
412418
@user_has_permissions("manage_service")
413419
def service_add_email_reply_to(service_id):
420+
back = request.args.get("back")
421+
template_id = request.args.get("template_id")
422+
423+
backlink = None
424+
425+
if back == "email_reply_to" and template_id:
426+
backlink = url_for(".service_email_reply_to", service_id=service_id, template_id=template_id, back="from_name")
427+
414428
form = ServiceReplyToEmailForm()
415429
first_email_address = current_service.count_email_reply_to_addresses == 0
416430
is_default = first_email_address if first_email_address else form.is_default.data
@@ -451,6 +465,7 @@ def service_add_email_reply_to(service_id):
451465
form=form,
452466
first_email_address=first_email_address,
453467
error_summary_enabled=True,
468+
alternative_backlink=backlink,
454469
)
455470

456471

app/templates/views/service-settings/email-reply-to/add.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% endblock %}
1010

1111
{% block backLink %}
12-
{{ govukBackLink({ "href": url_for('main.service_email_reply_to', service_id=current_service.id) }) }}
12+
{{ govukBackLink({ "href": alternative_backlink or url_for('main.service_email_reply_to', service_id=current_service.id) }) }}
1313
{% endblock %}
1414

1515
{% block maincolumn_content %}

app/templates/views/service-settings/email_reply_to.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,14 @@
99
{% endblock %}
1010

1111
{% block backLink %}
12-
{{ govukBackLink({ "href": url_for('main.service_settings', service_id=current_service.id) }) }}
12+
{{ govukBackLink({ "href": alternative_backlink or url_for('main.service_settings', service_id=current_service.id) }) }}
1313
{% endblock %}
1414

1515
{% block maincolumn_content %}
1616

17-
{{ page_header('Reply-to email addresses') }}
17+
{{ page_header('Let recipients reply to your emails') }}
1818

1919
<div class="user-list">
20-
{% if not current_service.email_reply_to_addresses %}
21-
<div class="user-list-item">
22-
<p class="govuk-body user-list-item-blank hint">You have not added any reply-to email addresses yet</p>
23-
</div>
24-
{% endif %}
2520
{% for item in current_service.email_reply_to_addresses %}
2621
<div class="user-list-item">
2722
<div class="govuk-grid-row">
@@ -59,23 +54,31 @@ <h2 class="user-list-item-heading">
5954
{{ govukButton({
6055
"element": "a",
6156
"text": "Add reply-to email address",
62-
"href": url_for('main.service_add_email_reply_to', service_id=current_service.id),
57+
"href": url_for('main.service_add_email_reply_to', service_id=current_service.id, back="email_reply_to", template_id=template_id),
6358
}) }}
6459
</div>
6560
{% endif %}
6661
</div>
6762
<div class="govuk-grid-column-five-sixths">
6863
<p class="govuk-body">
69-
You need to add at least one reply-to address so recipients can reply to your messages.
64+
You must set up a reply-to email address for your service.
7065
</p>
7166
<p class="govuk-body">
72-
Emails with a reply-to address:
67+
Emails with a reply-to address are:
7368
</p>
7469
<ul class="govuk-list govuk-list--bullet">
75-
<li>are less likely to be labelled as spam</li>
76-
<li>appear more trustworthy</li>
70+
<li>more likely to be delivered</li>
71+
<li>less likely to end up in a junk folder</li>
72+
<li>less likely to be reported as spam</li>
7773
</ul>
7874
</div>
75+
<div class="govuk-grid-column-five-sixths">
76+
<p class="govuk-body">
77+
<a href="{{ url_for('main.add_recipients', service_id=service_id, template_id=template_id, back="email_reply_to") }}" class="govuk-link govuk-link--no-visited-state">
78+
I’ll do this later
79+
</a>
80+
</p>
81+
</div>
7982
</div>
8083

8184
{% endblock %}

0 commit comments

Comments
 (0)