From 450af592d2a0a624f41f6dceae805dcdc3056ece Mon Sep 17 00:00:00 2001 From: Warren Smithson <36073378+warrenskiwork1979@users.noreply.github.com> Date: Tue, 30 May 2023 10:23:06 +0100 Subject: [PATCH] VEOSS-1428 | Create new template for amend registration (#1055) VEOSS-1428 | Modify content following review recommendations VEOSS-1428 | Change email subject for consistency with rest of template --- app/preview/TemplateParams.scala | 8 +++ .../templates/oss/OSSTemplates.scala | 9 +++ ...stration_amendment_confirmation.scala.html | 27 ++++++++ ...istration_amendment_confirmation.scala.txt | 9 +++ .../templates/TemplateLocatorSpec.scala | 1 + ...egistrationAmendmentConfirmationSpec.scala | 68 +++++++++++++++++++ 6 files changed, 122 insertions(+) create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.txt create mode 100644 test/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSRegistrationAmendmentConfirmationSpec.scala diff --git a/app/preview/TemplateParams.scala b/app/preview/TemplateParams.scala index c42ae7669..7361f504c 100644 --- a/app/preview/TemplateParams.scala +++ b/app/preview/TemplateParams.scala @@ -1714,6 +1714,10 @@ object TemplateParams2 { "period" -> "1 July to 30 September 2021", "paymentDeadline" -> "31 October 2021" ), + "oss_registration_amendment_confirmation" -> Map( + "recipientName_line1" -> "Joe Bloggs", + "amendmentDate" -> "23 May 2023" + ), "platformContact" -> Map( "apiTitle" -> "Individuals Tax Relief for Kitten Ownership", "senderName" -> "Alice Example", @@ -3052,6 +3056,10 @@ object TemplateParams2 { "period" -> "1 July to 30 September 2021", "paymentDeadline" -> "31 October 2021" ), + "oss_registration_amendment_confirmation" -> Map( + "recipientName_line1" -> "Joe Bloggs", + "amendmentDate" -> "23 May 2023" + ), "pods_psa_amend" -> Map( "psaName" -> "Jane Doe" ), diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSTemplates.scala b/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSTemplates.scala index c391dc827..b1ba0f923 100644 --- a/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSTemplates.scala +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSTemplates.scala @@ -58,6 +58,15 @@ object OSSTemplates { plainTemplate = txt.oss_overdue_returns_email_confirmation.f, htmlTemplate = html.oss_overdue_returns_email_confirmation.f, priority = Some(MessagePriority.Background) + ), + MessageTemplate.create( + templateId = "oss_registration_amendment_confirmation", + fromAddress = FromAddress.noReply("VAT One Stop Shop Team"), + service = OSS, + subject = "HMRC: One Stop Shop details updated", + plainTemplate = txt.oss_registration_amendment_confirmation.f, + htmlTemplate = html.oss_registration_amendment_confirmation.f, + priority = Some(MessagePriority.Background) ) ) } diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.html new file mode 100644 index 000000000..e62ba31e6 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.html @@ -0,0 +1,27 @@ +@* + * 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, "One Stop Shop registration details updated") { +@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.salutation(params) +

+ You successfully updated your One Stop Shop registration details on @params("amendmentDate"). +

+

+ From the VAT One Stop Shop team +

+ +} \ No newline at end of file diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.txt new file mode 100644 index 000000000..fb3109afa --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/oss/oss_registration_amendment_confirmation.scala.txt @@ -0,0 +1,9 @@ +@(params: Map[String, Any])One Stop Shop registration details updated + +@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.txt.salutation(params) + +You successfully updated your One Stop Shop registration details on @params("amendmentDate"). + +From the VAT One Stop Shop team + +@{uk.gov.hmrc.hmrcemailrenderer.templates.helpers.txt.template_footer()} diff --git a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala index cd003f645..8aeddcbe2 100644 --- a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala +++ b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala @@ -902,6 +902,7 @@ class TemplateLocatorSpec extends AnyWordSpecLike with should.Matchers with Opti "oss_returns_email_confirmation", "oss_overdue_returns_email_confirmation", "oss_returns_email_confirmation_no_vat_owed", + "oss_registration_amendment_confirmation", "platformContact", "platformContactConfirmation", "pods_psa_amend", diff --git a/test/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSRegistrationAmendmentConfirmationSpec.scala b/test/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSRegistrationAmendmentConfirmationSpec.scala new file mode 100644 index 000000000..9fbebed6e --- /dev/null +++ b/test/uk/gov/hmrc/hmrcemailrenderer/templates/oss/OSSRegistrationAmendmentConfirmationSpec.scala @@ -0,0 +1,68 @@ +/* + * 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. + */ + +package uk.gov.hmrc.hmrcemailrenderer.templates.oss + +import org.scalatest.{ EitherValues, OptionValues } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike +import uk.gov.hmrc.hmrcemailrenderer.domain.MessagePriority +import uk.gov.hmrc.hmrcemailrenderer.templates.ServiceIdentifier.OSS +import uk.gov.hmrc.hmrcemailrenderer.templates.{ CommonParamsForSpec, TemplateLoader, TemplateLocator } + +class OSSRegistrationAmendmentConfirmationSpec + extends AnyWordSpecLike with Matchers with OptionValues with EitherValues with TemplateLoader + with CommonParamsForSpec { + + "OSS Registration Amendment Confirmation" should { + + val templateLocator = new TemplateLocator {} + val params = commonParameters ++ Map( + "recipientName_line1" -> "Joe Bloggs", + "amendmentDate" -> "23 May 2023" + ) + val template = templateLocator + .templateGroups("OSS") + .find(_.templateId == "oss_registration_amendment_confirmation") + .get + + "render correct meta information" in { + template.templateId shouldBe "oss_registration_amendment_confirmation" + template.service shouldBe OSS + template.fromAddress(Map.empty) shouldBe "VAT One Stop Shop Team " + template.subject(Map.empty) shouldBe "HMRC: One Stop Shop details updated" + template.priority shouldBe Some(MessagePriority.Background) + } + + "render correct html content" in { + val htmlContent = template.htmlTemplate(params).toString() + + htmlContent should include("Dear Joe Bloggs") + htmlContent should include("One Stop Shop registration details updated") + htmlContent should include("You successfully updated your One Stop Shop registration details on 23 May 2023.") + htmlContent should include("From the VAT One Stop Shop team") + } + + "render correct text content" in { + val txtContent = template.plainTemplate(params).toString() + + txtContent should include("Dear Joe Bloggs") + txtContent should include("One Stop Shop registration details updated") + txtContent should include("You successfully updated your One Stop Shop registration details on 23 May 2023.") + txtContent should include("From the VAT One Stop Shop team") + } + } +}