diff --git a/app/preview/TemplateParams.scala b/app/preview/TemplateParams.scala index 6e9464599..43121f859 100644 --- a/app/preview/TemplateParams.scala +++ b/app/preview/TemplateParams.scala @@ -1652,6 +1652,15 @@ object TemplateParams2 { "hipp_application_deleted_team" -> Map( "applicationname" -> "Test-Hipp-App" ), + "hipp_api_ownership_added_email" -> Map( + "teamname" -> "My Team", + "apispecificationname" -> "API Name" + ), + "hipp_api_ownership_removed_email" -> Map( + "teamname" -> "My Team", + "otherteamname" -> "New API Team", + "apispecificationname" -> "API Name" + ), "chargeable_return_submit" -> Map( "first_name" -> "FirstName", "last_name" -> "SecondName", diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipAdded.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipAdded.scala.html new file mode 100644 index 000000000..02e8f0f83 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipAdded.scala.html @@ -0,0 +1,23 @@ +@* + * 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, "There has been a change of API ownership"){ +
Your team @params("teamname") is the new owner of @params("apispecificationname").
+To view this change, visit /api-hub on the MDTP admin network.
+If this is an error, please follow the Get Support link on the Hub.
+From HMRC The Integration Hub
+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipAdded.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipAdded.scala.txt new file mode 100644 index 000000000..4312340a1 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipAdded.scala.txt @@ -0,0 +1,5 @@ +@(params: Map[String, Any]) +Your team @params("teamname") is the new owner of @params("apispecificationname"). +To view this change, visit /api-hub on the MDTP admin network. +If this is an error, please follow the Get Support link on the Hub. +From HMRC The Integration Hub diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipRemoved.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipRemoved.scala.html new file mode 100644 index 000000000..41c74f8f3 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipRemoved.scala.html @@ -0,0 +1,23 @@ +@* + * 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, "There has been a change of API ownership"){ +Your team @params("teamname") is no longer the owner of @params("apispecificationname"). The team @params("otherteamname") is now the new owner of this API.
+To view this change, visit /api-hub on the MDTP admin network.
+If this is an error, please follow the Get Support link on the Hub.
+From HMRC The Integration Hub
+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipRemoved.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipRemoved.scala.txt new file mode 100644 index 000000000..62682ec32 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/ApiOwnershipRemoved.scala.txt @@ -0,0 +1,5 @@ +@(params: Map[String, Any]) +Your team @params("teamname") is no longer the owner of @params("apispecificationname"). The team @params("otherteamname") is now the new owner of this API. +To view this change, visit /api-hub on the MDTP admin network. +If this is an error, please follow the Get Support link on the Hub. +From HMRC The Integration Hub diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala index 483721f4e..985dd43a1 100644 --- a/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/hipp/HippTemplates.scala @@ -112,6 +112,24 @@ object HippTemplates { plainTemplate = txt.ProductionAccessRequestSubmitted.f, htmlTemplate = html.ProductionAccessRequestSubmitted.f, priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "hipp_api_ownership_added_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Hipp, + subject = "There has been a change of API ownership", + plainTemplate = txt.ApiOwnershipAdded.f, + htmlTemplate = html.ApiOwnershipAdded.f, + priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "hipp_api_ownership_removed_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Hipp, + subject = "There has been a change of API ownership", + plainTemplate = txt.ApiOwnershipRemoved.f, + htmlTemplate = html.ApiOwnershipRemoved.f, + priority = Some(MessagePriority.Urgent) ) ) } diff --git a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala index 202155a26..9d31c2daf 100644 --- a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala +++ b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala @@ -533,6 +533,8 @@ class TemplateLocatorSpec extends AnyWordSpecLike with should.Matchers with Opti "hipp_application_deleted", "hipp_application_deleted_team", "hipp_remove_team_member_from_app_email", + "hipp_api_ownership_added_email", + "hipp_api_ownership_removed_email", "ho10_confirmation_submission", "ho10_confirmation_submission_cy", "ho5_code",