From 3b1a3ac095156d64fae6441c884aa58e6ccb0565 Mon Sep 17 00:00:00 2001 From: ewelinagr Date: Fri, 12 Apr 2019 14:08:29 +0200 Subject: [PATCH] Update subscription email template --- .../groovy/nl/thehyve/gb/backend/EmailGenerator.groovy | 8 ++++---- .../nl/thehyve/gb/backend/user/EmailGeneratorSpec.groovy | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gb-backend/src/main/groovy/nl/thehyve/gb/backend/EmailGenerator.groovy b/gb-backend/src/main/groovy/nl/thehyve/gb/backend/EmailGenerator.groovy index 0f6c81a..7b1c52f 100644 --- a/gb-backend/src/main/groovy/nl/thehyve/gb/backend/EmailGenerator.groovy +++ b/gb-backend/src/main/groovy/nl/thehyve/gb/backend/EmailGenerator.groovy @@ -23,7 +23,7 @@ class EmailGenerator { static String getQuerySubscriptionUpdatesSubject(String clientAppName, Date reportDate) { [ clientAppName, - 'Query subscription updates', + 'Cohort subscription updates', DATE_FORMAT.format(reportDate) ].join(SUBJECT_PARTS_SEPARATOR) } @@ -31,7 +31,7 @@ class EmailGenerator { /** * Generates an email for specific user with data updates for queries the user is subscribed for, grouped by query type. * - * The email contains a list of each query, grouped by query type, with changed results, containing: + * The email contains a list of each query (cohort), grouped by query type, with changed results, containing: * - a name of the query, * - number of added and removed objects that the query relates to * - over what period the change was @@ -45,12 +45,12 @@ class EmailGenerator { String header = [ 'Hello,', '', - "You have subscribed to be notified to data updates for one or more queries that you have saved in the \"${clientAppName}\" application.", + "You have subscribed to be notified to data updates for one or more cohorts that you have saved in the \"${clientAppName}\" application.", "In this email you will find an overview of all data updates up until ${DATE_TIME_FORMAT.format(reportDate)}:", ].join(BR) String updateInfo = htmlTablesGroupedByType(queryTypeToQuerySetsChanges) String footer = [ - "You can login to ${clientAppName} to reload your queries and review the new data available.", + "You can login to ${clientAppName} to reload your cohorts and review the new data available.", 'Regards,', '', clientAppName, diff --git a/gb-backend/src/test/groovy/nl/thehyve/gb/backend/user/EmailGeneratorSpec.groovy b/gb-backend/src/test/groovy/nl/thehyve/gb/backend/user/EmailGeneratorSpec.groovy index d496fe4..5761f1b 100644 --- a/gb-backend/src/test/groovy/nl/thehyve/gb/backend/user/EmailGeneratorSpec.groovy +++ b/gb-backend/src/test/groovy/nl/thehyve/gb/backend/user/EmailGeneratorSpec.groovy @@ -21,7 +21,7 @@ class EmailGeneratorSpec extends Specification { String clientAppName = 'ABC' Date reportDate = DATE_FORMAT.parse('2018-10-03') expect: - EmailGenerator.getQuerySubscriptionUpdatesSubject(clientAppName, reportDate) == 'ABC - Query subscription updates - October 3 2018' + EmailGenerator.getQuerySubscriptionUpdatesSubject(clientAppName, reportDate) == 'ABC - Cohort subscription updates - October 3 2018' } def 'body of the query subscription updates'() { @@ -59,7 +59,7 @@ class EmailGeneratorSpec extends Specification { ] Date reportDate = DATE_TIME_FORMAT.parse('2018-10-03 15:25') def expectedContent = 'Hello,

' + - 'You have subscribed to be notified to data updates for one or more queries that you have saved in the "ABC" application.' + + 'You have subscribed to be notified to data updates for one or more cohorts that you have saved in the "ABC" application.' + '
In this email you will find an overview of all data updates up until October 3 2018 15:25:' + '

Cohort changes (type Diagnosis):' + '
' + @@ -72,7 +72,7 @@ class EmailGeneratorSpec extends Specification { '' + '' + '
first saved query3531May 3 2017 13:30
test query5062August 16 2017 8:45
' + - '

You can login to ABC to reload your queries and review the new data available.' + + '

You can login to ABC to reload your cohorts and review the new data available.' + '
Regards,

ABC' when: def realContent = EmailGenerator.getQuerySubscriptionUpdatesBody(querySetChanges, clientAppName, reportDate)