Skip to content

Commit

Permalink
VEOSS-1428 | Create new template for amend registration (#1055)
Browse files Browse the repository at this point in the history
VEOSS-1428 | Modify content following review recommendations

VEOSS-1428 | Change email subject for consistency with rest of template
  • Loading branch information
warrenskiwork1979 authored May 30, 2023
1 parent c4a9c7d commit 450af59
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/preview/TemplateParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
)
}
Original file line number Diff line number Diff line change
@@ -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)
<p style="margin: 0px 0 30px; font-size: 19px;">
You successfully updated your One Stop Shop registration details on @params("amendmentDate").
</p>
<p style="margin: 0px 0 30px; font-size: 19px;">
From the VAT One Stop Shop team
</p>

}
Original file line number Diff line number Diff line change
@@ -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()}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <noreply@tax.service.gov.uk>"
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")
}
}
}

0 comments on commit 450af59

Please sign in to comment.