Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Email Signup to send verification email. #27277

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions common/app/controllers/EmailSignupController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,14 @@ class EmailFormService(wsClient: WSClient, emailEmbedAgent: NewsletterSignupAgen
.obj(
"email" -> form.email,
"set-lists" -> form.listNames,
"refViewId" -> form.refViewId,
akinsola-guardian marked this conversation as resolved.
Show resolved Hide resolved
"ref" -> form.ref,
)
.fields,
)

val queryStringParameters = form.ref.map("ref" -> _).toList ++
form.refViewId.map("refViewId" -> _).toList ++
form.listNames.map("listName" -> _).toList

//FIXME: this should go via the identity api client / app
// NOTE - always using the '/consent-signup' (no confirmation email)
// should we be splitting the list into newsletters that require confirmation
// and those that don't, then sending two separate requests?
// Currently, no editorial newsletters require confirmation emails, but the
// feature is still supported.
wsClient
.url(s"${Configuration.id.apiRoot}/consent-signup")
.withQueryStringParameters(queryStringParameters: _*)
.url(s"${Configuration.id.apiRoot}/consent-email")
.addHttpHeaders(getHeaders(request): _*)
.post(consentMailerPayload)
}
Expand Down