From 44859e9c5756ae0c69a56942ae3612097ce48cd1 Mon Sep 17 00:00:00 2001 From: besscerule Date: Mon, 30 Sep 2024 08:50:39 +0100 Subject: [PATCH] DC-6712 Trader Goods Profile Email notification on file available to download (#1185) * Added email * linting * linting again --- app/preview/TemplateParams.scala | 6 +++ .../templates/ServiceIdentifier.scala | 1 + .../templates/TemplateLocator.scala | 2 + .../tgp/DownloadRecordNotification.scala.html | 31 +++++++++++++ .../tgp/DownloadRecordNotification.scala.txt | 11 +++++ .../DownloadRecordNotification_cy.scala.html | 30 +++++++++++++ .../DownloadRecordNotification_cy.scala.txt | 11 +++++ .../templates/tgp/TgpTemplates.scala | 45 +++++++++++++++++++ .../templates/TemplateLocatorSpec.scala | 7 ++- 9 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.txt create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.html create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.txt create mode 100644 app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/TgpTemplates.scala diff --git a/app/preview/TemplateParams.scala b/app/preview/TemplateParams.scala index f1d89505e..a3737a20d 100644 --- a/app/preview/TemplateParams.scala +++ b/app/preview/TemplateParams.scala @@ -3782,6 +3782,12 @@ object TemplateParams3 { "agencyName" -> "Test Agent", "failedChecks" -> "Agent (individual) is deceased | Agent is present on the 'Refuse to Deal With' list", "dateTime" -> "26 April 2024 08:34am" + ), + "tgp_download_record_notification_email" -> Map( + "expiredDate" -> "18 August 2024" + ), + "tgp_download_record_notification_email_cy" -> Map( + "expiredDate" -> "18 Awst 2024" ) ) } diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/ServiceIdentifier.scala b/app/uk/gov/hmrc/hmrcemailrenderer/templates/ServiceIdentifier.scala index 4cfa47d5a..9117e3bad 100644 --- a/app/uk/gov/hmrc/hmrcemailrenderer/templates/ServiceIdentifier.scala +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/ServiceIdentifier.scala @@ -126,6 +126,7 @@ object ServiceIdentifier { case object EconomicCrimeLevy extends ServiceIdentifier { override val name = "ecl" } case object Hipp extends ServiceIdentifier { override val name = "hipp" } case object PenReform extends ServiceIdentifier { override val name = "penaltyReform" } + case object Tgp extends ServiceIdentifier { override val name = "tgp" } case object Feedback extends ServiceIdentifier { override val name = "feedback" } } diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocator.scala b/app/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocator.scala index ca8ea2e8b..4ebab4bd3 100644 --- a/app/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocator.scala +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocator.scala @@ -94,6 +94,7 @@ import uk.gov.hmrc.hmrcemailrenderer.templates.ioss.IossTemplates import uk.gov.hmrc.hmrcemailrenderer.templates.penaltyreform.PenReformTemplates import uk.gov.hmrc.hmrcemailrenderer.templates.tctr.TctrTemplates import uk.gov.hmrc.hmrcemailrenderer.templates.tctr.TctrTemplates.tctrGroup +import uk.gov.hmrc.hmrcemailrenderer.templates.tgp.TgpTemplates trait TemplateLocator { def templateGroups: Map[String, Seq[MessageTemplate]] = @@ -172,6 +173,7 @@ trait TemplateLocator { "ECL" -> EclTemplates.templates, "HIPP" -> HippTemplates.templates, "Penalty Reform" -> PenReformTemplates.templates, + "TGP" -> TgpTemplates.templates, FeedbackTemplates.id -> FeedbackTemplates.templates ) diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.html new file mode 100644 index 000000000..c3665c000 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.html @@ -0,0 +1,31 @@ +@* + * 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 Trader Goods Profile (TGP) records file is ready to download", showHeading1 = false) { +

Dear customer

+

Your records file that you asked for is ready to download.

+

To get your file:

+
    +
  1. Go to GOV.UK
  2. +
  3. Search for 'Trader Goods Profile'
  4. +
  5. Log in to your profile
  6. +
  7. Select the new notification on your homepage.
  8. +
+

The file will be available until @params("expiredDate").

+

To get the file again, you can find a link on your goods records page.

+

From the Trader Goods Profile team

+ +} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.txt new file mode 100644 index 000000000..9ac10c0e4 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification.scala.txt @@ -0,0 +1,11 @@ +@(params: Map[String, Any]) +Dear customer +Your records file that you asked for is ready to download. +To get your file: +1. Go to GOV.UK +2. Search for 'Trader Goods Profile' +3. Log in to your profile +4. Select the new notification on your homepage. +The file will be available until @params("expiredDate"). +To get the file again, you can find a link on your goods records page. +From the Trader Goods Profile team \ No newline at end of file diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.html b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.html new file mode 100644 index 000000000..84fef1231 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.html @@ -0,0 +1,30 @@ +@* + * 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, "Mae’r ffeil sy’n cynnwys cofnodion eich Proffil Nwyddau Masnachwr (TGP) yn barod i’w lawrlwytho", showHeading1 = false) { +

Annwyl gwsmer

+

Mae’r ffeil y gofynnoch amdano, sy’n cynnwys eich cofnodion TGP, yn barod i’w lawrlwytho.

+

Er mwyn cael mynediad at eich ffeil:

+
    +
  1. Ewch i GOV.UK
  2. +
  3. Chwiliwch am ‘Trader Goods Profile’
  4. +
  5. Mewngofnodwch i’ch proffil
  6. +
  7. Dewiswch yr hysbysiad newydd sy’n ymddangos ar eich hafan.
  8. +
+

Bydd y ffeil ar gael ta @params("expiredDate").

+

I gael mynediad at y ffeil eto, gweler y cysylltiad sydd ar eich tudalen Cofnodion Nwyddau.

+

Y Tîm Proffil Nwyddau Masnachwyr

+} diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.txt b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.txt new file mode 100644 index 000000000..b86e1a495 --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/DownloadRecordNotification_cy.scala.txt @@ -0,0 +1,11 @@ +@(params: Map[String, Any]) +Annwyl gwsmer +Mae’r ffeil y gofynnoch amdano, sy’n cynnwys eich cofnodion TGP, yn barod i’w lawrlwytho. +Er mwyn cael mynediad at eich ffeil: +1. Ewch i GOV.UK +2. Chwiliwch am ‘Trader Goods Profile’ +3. Mewngofnodwch i’ch proffil +4. Dewiswch yr hysbysiad newydd sy’n ymddangos ar eich hafan. +Bydd y ffeil ar gael ta @params("expiredDate"). +I gael mynediad at y ffeil eto, gweler y cysylltiad sydd ar eich tudalen Cofnodion Nwyddau. +Y Tîm Proffil Nwyddau Masnachwyr diff --git a/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/TgpTemplates.scala b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/TgpTemplates.scala new file mode 100644 index 000000000..ae29af21a --- /dev/null +++ b/app/uk/gov/hmrc/hmrcemailrenderer/templates/tgp/TgpTemplates.scala @@ -0,0 +1,45 @@ +/* + * 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.tgp + +import uk.gov.hmrc.hmrcemailrenderer.domain.{ MessagePriority, MessageTemplate } +import uk.gov.hmrc.hmrcemailrenderer.templates.FromAddress +import uk.gov.hmrc.hmrcemailrenderer.templates.ServiceIdentifier.Tgp + +object TgpTemplates { + + val templates = Seq( + MessageTemplate.create( + templateId = "tgp_download_record_notification_email", + fromAddress = FromAddress.noReply("Do not reply"), + service = Tgp, + subject = "Your TGP records file is ready to download", + plainTemplate = txt.DownloadRecordNotification.f, + htmlTemplate = html.DownloadRecordNotification.f, + priority = Some(MessagePriority.Urgent) + ), + MessageTemplate.create( + templateId = "tgp_download_record_notification_email_cy", + fromAddress = FromAddress.noReply("Do not reply"), + service = Tgp, + subject = "Mae’r ffeil sy’n cynnwys cofnodion eich TGP yn barod i’w lawrlwytho", + plainTemplate = txt.DownloadRecordNotification_cy.f, + htmlTemplate = html.DownloadRecordNotification_cy.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 943a164b3..a0b529bdd 100644 --- a/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala +++ b/test/uk/gov/hmrc/hmrcemailrenderer/templates/TemplateLocatorSpec.scala @@ -141,7 +141,8 @@ class TemplateLocatorSpec extends AnyWordSpecLike with should.Matchers with Opti "Penalty Reform", FeedbackTemplates.id, "DASS", - "IOSS" + "IOSS", + "TGP" ) } @@ -1049,7 +1050,9 @@ class TemplateLocatorSpec extends AnyWordSpecLike with should.Matchers with Opti "new_message_alert_m08_ioss", "new_message_alert_m08_ioss_cy", "new_message_alert_m08a_ioss", - "new_message_alert_m08a_ioss_cy" + "new_message_alert_m08a_ioss_cy", + "tgp_download_record_notification_email", + "tgp_download_record_notification_email_cy" ) } }