Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API-6864 - updated ApiApplicationToBeDeletedNotification template #1048

Merged
merged 3 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/preview/TemplateParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ object TemplateParams {
"applicationName" -> "Tax Software"
),
"apiApplicationToBeDeletedNotification" -> Map(
"userFirstName" -> "Fred",
"userLastName" -> "Bloggs",
"applicationName" -> "Test Application",
"environmentName" -> "Sandbox",
"timeSinceLastUse" -> "11 months",
"dateOfScheduledDeletion" -> "1 April 2025"
"userFirstName" -> "Fred",
"userLastName" -> "Bloggs",
"applicationName" -> "Test Application",
"environmentName" -> "Sandbox",
"timeSinceLastUse" -> "11 months",
"daysToDeletion" -> "30 days"
),
"apiProductionCredentialsRequestExpired" -> Map(
"applicationName" -> "Test Application"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@(params: Map[String, Any])
@uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.template_main(params, "We’re deleting your application") {
<p style="margin: 0 0 30px; font-size: 19px;">Dear @{params("userFirstName")} @{params("userLastName")}</p>
<p style="margin: 0 0 30px; font-size: 19px;">Your <strong>@{params("environmentName")}</strong> application <strong>@{params("applicationName")}</strong> has been inactive for more than <strong>@{params("timeSinceLastUse")}</strong> and will be deleted on <strong>@{params("dateOfScheduledDeletion")}</strong>.</p>
<p style="margin: 0 0 30px; font-size: 19px;">Your <strong>@{params("environmentName")}</strong> application <strong>@{params("applicationName")}</strong> has been inactive for more than <strong>@{params("timeSinceLastUse")}</strong> and will be deleted in <strong>@{params("daysToDeletion")}</strong>.</p>
<p style="margin: 0 0 30px; font-size: 19px;">To keep this application, use it to make an API call before the deletion date.</p>
<p style="margin: 0 0 30px; font-size: 19px;">If you do nothing, we will automatically delete this application.</p>
<p style="margin: 0 0 30px; font-size: 19px;">Do not reply to this email, this inbox is not monitored.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Dear @{params("userFirstName")} @{params("userLastName")}

Your @{params("environmentName")} application @{params("applicationName")} has been inactive for more than @{params("timeSinceLastUse")} and will be deleted on @{params("dateOfScheduledDeletion")}.
Your @{params("environmentName")} application @{params("applicationName")} has been inactive for more than @{params("timeSinceLastUse")} and will be deleted in @{params("daysToDeletion")}.

To keep this application, use it to make an API call before the deletion date.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*@


@(params: Map[String, Any], default: String = "")@(if(params.getOrElse("serviceName", "") == "Cael rhif EORI")"Mae’ch rhif EORI yn barod i’w ddefnyddio" else params.get("enrolmentKey").map({
case "HMRC-ATAR-ORG" => "Mae’ch tanysgrifiad i ddyfarniadau tariffau uwch a’ch rhif EORI yn barod i’w defnyddio"
case "HMRC-GVMS-ORG" => "Mae’ch tanysgrifiad i’r Gwasanaeth Symud Cerbydau Nwyddau a’ch rhif EORI yn barod i’w defnyddio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@*
* 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.
*@
* 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.
*@

@import uk.gov.hmrc.hmrcemailrenderer.templates.onlinepaymentservice.AmountFormatter.formatAmountInPence

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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.api

import junit.framework.TestCase
import org.scalatest.wordspec.AnyWordSpecLike
import org.scalatest.matchers.should.Matchers
import uk.gov.hmrc.hmrcemailrenderer.templates.api

class ApiApplicationToBeDeletedNotificationSpec extends AnyWordSpecLike with Matchers {

val userFirstName = "Fred"
val userLastName = "Bloggs"
val applicationName = "Test Application"
val environmentName = "Sandbox"
val timeSinceLastUse = "11 months"
val daysToDeletion = "30 days"

val templateParams = Map(
"userFirstName" -> userFirstName,
"userLastName" -> userLastName,
"applicationName" -> applicationName,
"environmentName" -> environmentName,
"timeSinceLastUse" -> timeSinceLastUse,
"daysToDeletion" -> daysToDeletion,
"staticAssetUrlPrefix" -> "http://uri",
"staticAssetVersion" -> "v1",
"borderColour" -> "#005EA5"
)

"htmlView" should {
"render as" in new TestCase {
val renderedHtml = api.html.apiApplicationToBeDeletedNotification.render(templateParams)
renderedHtml.contentType should include("text/html")
renderedHtml.body should include(
"<p style=\"margin: 0 0 30px; font-size: 19px;\">Dear " + userFirstName + " " + userLastName + "</p>"
)
renderedHtml.body should include(
"<p style=\"margin: 0 0 30px; font-size: 19px;\">Your <strong>" + environmentName +
"</strong> application <strong>" + applicationName + "</strong>" +
" has been inactive for more than <strong>" + timeSinceLastUse +
"</strong> and will be deleted in <strong>" + daysToDeletion + "</strong>.</p>"
)
renderedHtml.body should include("<p style=\"margin: 0 0 30px; font-size: 19px;\">From HMRC Developer Hub</p>")
}
}

"textView" should {
"render as" in new TestCase {
val renderedTxt = api.txt.apiApplicationToBeDeletedNotification.render(templateParams)
renderedTxt.contentType should include("text/plain")
renderedTxt.body should include(s"Dear $userFirstName $userLastName")
renderedTxt.body should include(
s"Your $environmentName application $applicationName " +
s"has been inactive for more than $timeSinceLastUse and will be deleted in $daysToDeletion.")
renderedTxt.body should include("From HMRC Developer Hub")
}

}
}