diff --git a/app/main/forms.py b/app/main/forms.py index 0d6761f7d7..72925c5616 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -553,7 +553,11 @@ def __init__(self, *args, **kwargs): class SendingDomainForm(StripWhitespaceForm): - sending_domain = StringField(_l("Sending domain"), validators=[]) + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.sending_domain.choices = kwargs["sending_domain_choices"] + + sending_domain = SelectField(_l("Sending domain"), validators=[]) class RenameOrganisationForm(StripWhitespaceForm): diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index fd7dd363fe..3d9a09ca5c 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -72,6 +72,7 @@ email_safe, get_logo_cdn_domain, get_new_default_reply_to_address, + get_verified_ses_domains, user_has_permissions, user_is_gov_user, user_is_platform_admin, @@ -549,7 +550,7 @@ def service_set_reply_to_email(service_id): @main.route("/services//service-settings/sending-domain", methods=["GET", "POST"]) @user_is_platform_admin def service_sending_domain(service_id): - form = SendingDomainForm() + form = SendingDomainForm(sending_domain_choices=get_verified_ses_domains()) if request.method == "GET": form.sending_domain.data = current_service.sending_domain