Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Update subscription email template
Browse files Browse the repository at this point in the history
  • Loading branch information
ewelinagr committed Apr 12, 2019
1 parent a1e1380 commit 3b1a3ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class EmailGenerator {
static String getQuerySubscriptionUpdatesSubject(String clientAppName, Date reportDate) {
[
clientAppName,
'Query subscription updates',
'Cohort subscription updates',
DATE_FORMAT.format(reportDate)
].join(SUBJECT_PARTS_SEPARATOR)
}

/**
* 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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'() {
Expand Down Expand Up @@ -59,7 +59,7 @@ class EmailGeneratorSpec extends Specification {
]
Date reportDate = DATE_TIME_FORMAT.parse('2018-10-03 15:25')
def expectedContent = 'Hello,<br /><br />' +
'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.' +
'<br />In this email you will find an overview of all data updates up until October 3 2018 15:25:' +
'<p />Cohort changes (type <b>Diagnosis</b>):' +
'<br /><table cellpadding="10"><tr>' +
Expand All @@ -72,7 +72,7 @@ class EmailGeneratorSpec extends Specification {
'<tr><td>first saved query</td><td>35</td><td>3</td><td>1</td><td>May 3 2017 13:30</td></tr>' +
'<tr><td>test query</td><td>50</td><td>6</td><td>2</td><td>August 16 2017 8:45</td></tr>' +
'</table>' +
'<p />You can login to ABC to reload your queries and review the new data available.' +
'<p />You can login to ABC to reload your cohorts and review the new data available.' +
'<br />Regards,<br /><br />ABC'
when:
def realContent = EmailGenerator.getQuerySubscriptionUpdatesBody(querySetChanges, clientAppName, reportDate)
Expand Down

0 comments on commit 3b1a3ac

Please sign in to comment.