From 5f0165a3acd7271e4b9afbda7d0f7aafab137900 Mon Sep 17 00:00:00 2001 From: Mike Jackson Date: Thu, 7 Dec 2023 12:13:35 +0000 Subject: [PATCH] HIPP-885: New Email templates (#1122) * HIPP-460: You've -> You have * HIPP-460: You've -> You have * HIPP-885_new_email_templates * HIPP-885_new_email_templates * HIPP-885_new_email_templates * HIPP-885: Review actions --- app/preview/TemplateParams.scala | 16 +++++++++ .../templates/hipp/HippTemplates.scala | 36 +++++++++++++++++++ .../NewProductionAccessRequest.scala.html | 22 ++++++++++++ .../hipp/NewProductionAccessRequest.scala.txt | 4 +++ ...ProductionAccessRequestApproved.scala.html | 22 ++++++++++++ .../ProductionAccessRequestApproved.scala.txt | 4 +++ ...ProductionAccessRequestRejected.scala.html | 22 ++++++++++++ .../ProductionAccessRequestRejected.scala.txt | 4 +++ ...roductionAccessRequestSubmitted.scala.html | 22 ++++++++++++ ...ProductionAccessRequestSubmitted.scala.txt | 4 +++ .../templates/TemplateLocatorSpec.scala | 6 +++- 11 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.txt create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.txt create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.txt create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.txt diff --git a/app/preview/TemplateParams.scala b/app/preview/TemplateParams.scala index c8fe8e4c6..3abafbf11 100644 --- a/app/preview/TemplateParams.scala +++ b/app/preview/TemplateParams.scala @@ -1596,6 +1596,22 @@ object TemplateParams { object TemplateParams2 { val exampleLinkWithRandomId = s"http://host:8080/your/link/${UUID.randomUUID}" val exampleParams = Map( + "hipp_production_access_approved_email" -> Map( + "applicationname" -> "Test-Hipp-App", + "apispecificationname" -> "Test-Hipp-Api" + ), + "hipp_production_access_rejected_email" -> Map( + "applicationname" -> "Test-Hipp-App", + "apispecificationname" -> "Test-Hipp-Api" + ), + "hipp_new_production_access_request_email" -> Map( + "applicationname" -> "Test-Hipp-App", + "apispecificationname" -> "Test-Hipp-Api" + ), + "hipp_production_access_request_submitted_email" -> Map( + "applicationname" -> "Test-Hipp-App", + "apispecificationname" -> "Test-Hipp-Api" + ), "hipp_add_team_member_to_app_email" -> Map( "applicationname" -> "Test-Hipp-App", "creatorusername" -> "Test-Hipp-Member" diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala index 636812520..d6e354f31 100644 --- a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala @@ -67,6 +67,42 @@ object HippTemplates { plainTemplate = txt.ApplicationDeletedTeam.f, htmlTemplate = html.ApplicationDeletedTeam.f, priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "hipp_production_access_approved_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Hipp, + subject = "Your production access request has been approved", + plainTemplate = txt.ProductionAccessRequestApproved.f, + htmlTemplate = html.ProductionAccessRequestApproved.f, + priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "hipp_production_access_rejected_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Hipp, + subject = "Your production access request has been rejected", + plainTemplate = txt.ProductionAccessRequestRejected.f, + htmlTemplate = html.ProductionAccessRequestRejected.f, + priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "hipp_new_production_access_request_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Hipp, + subject = "A new production access request has been submitted for your review", + plainTemplate = txt.NewProductionAccessRequest.f, + htmlTemplate = html.NewProductionAccessRequest.f, + priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "hipp_production_access_request_submitted_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Hipp, + subject = "Your production access request was successfully submitted", + plainTemplate = txt.ProductionAccessRequestSubmitted.f, + htmlTemplate = html.ProductionAccessRequestSubmitted.f, + priority = Some(MessagePriority.Urgent) ) ) } diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.html new file mode 100644 index 000000000..46d880e6f --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.html @@ -0,0 +1,22 @@ +@* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *@ + +@(params: Map[String, Any]) +@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.template_main(params, "A new production access request has been submitted for your review"){ +

A request was submitted for the application @params("applicationname") to access the @params("apispecificationname") in the production environment.

+

To access the application, visit /api-hub on the MDTP admin network.

+

From HMRC The API Hub

+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.txt new file mode 100644 index 000000000..ce4cc1a94 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/NewProductionAccessRequest.scala.txt @@ -0,0 +1,4 @@ +@(params: Map[String, Any]) +A request was submitted for the application @{params("applicationname")} to access the @{params("apispecificationname")} in the production environment. +To access the application, visit /api-hub on the MDTP admin network. +From HMRC The API Hub \ No newline at end of file diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.html new file mode 100644 index 000000000..5d0b11e00 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.html @@ -0,0 +1,22 @@ +@* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *@ + +@(params: Map[String, Any]) +@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.template_main(params, "Your production access request has been approved"){ +

A request was submitted for your application @params("applicationname") to access the @params("apispecificationname") in the production environment. This request has now been approved.

+

To access the application, visit /api-hub on the MDTP admin network.

+

From HMRC The API Hub

+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.txt new file mode 100644 index 000000000..216c3c5af --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestApproved.scala.txt @@ -0,0 +1,4 @@ +@(params: Map[String, Any]) +A request was submitted for your application @{params("applicationname")} to access the @{params("apispecificationname")} in the production environment. This request has now been approved. +To access the application, visit /api-hub on the MDTP admin network. +From HMRC The API Hub \ No newline at end of file diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.html new file mode 100644 index 000000000..29ca4b7a3 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.html @@ -0,0 +1,22 @@ +@* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *@ + +@(params: Map[String, Any]) +@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.template_main(params, "Your production access request has been rejected"){ +

A request was submitted for your application @params("applicationname") to access the @params("apispecificationname") in the production environment. This request has been rejected.

+

To access the application, visit /api-hub on the MDTP admin network.

+

From HMRC The API Hub

+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.txt new file mode 100644 index 000000000..24af6a45c --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestRejected.scala.txt @@ -0,0 +1,4 @@ +@(params: Map[String, Any]) +A request was submitted for your application @{params("applicationname")} to access the @{params("apispecificationname")} in the production environment. This request has been rejected. +To access the application, visit /api-hub on the MDTP admin network. +From HMRC The API Hub \ No newline at end of file diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.html new file mode 100644 index 000000000..103114101 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.html @@ -0,0 +1,22 @@ +@* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *@ + +@(params: Map[String, Any]) +@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.template_main(params, "Your production access request was successfully submitted"){ +

Your request for your application @params("applicationname") to access the @params("apispecificationname") in the production environment has been successfully submitted for review.

+

To access the request, visit /api-hub on the MDTP admin network.

+

From HMRC The API Hub

+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.txt new file mode 100644 index 000000000..e690dcfe8 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ProductionAccessRequestSubmitted.scala.txt @@ -0,0 +1,4 @@ +@(params: Map[String, Any]) +Your request for your application @{params("applicationname")} to access the @{params("apispecificationname")} in the production environment has been successfully submitted for review. +To access the request, visit /api-hub on the MDTP admin network. +From HMRC The API Hub \ No newline at end of file diff --git a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala index b7cb2221c..52c65ade9 100644 --- a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala +++ b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala @@ -993,7 +993,11 @@ class TemplateLocatorSpec extends AnyWordSpecLike with should.Matchers with Opti "vishing_code_submission", "vishing_code_submission_cy", "xiEORI_change_confirmation", - "xiEORI_confirmation" + "xiEORI_confirmation", + "hipp_production_access_approved_email", + "hipp_production_access_rejected_email", + "hipp_new_production_access_request_email", + "hipp_production_access_request_submitted_email" ) } }