Skip to content

Commit

Permalink
Merge pull request #27463 from guardian/al-reimplement-query-string-p…
Browse files Browse the repository at this point in the history
…aram-consent-email

Add queryStringParameters to consent-email request
  • Loading branch information
akinsola-guardian authored Sep 9, 2024
2 parents 19aaa61 + 6602197 commit ca95871
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/app/controllers/EmailSignupController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ class EmailFormService(wsClient: WSClient, emailEmbedAgent: NewsletterSignupAgen
.fields,
)

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

wsClient
.url(s"${Configuration.id.apiRoot}/consent-email")
.withQueryStringParameters(queryStringParameters: _*)
.addHttpHeaders(getHeaders(request): _*)
.post(consentMailerPayload)
}
Expand Down

0 comments on commit ca95871

Please sign in to comment.