Skip to content

Commit e63dbfe

Browse files
Show Notify email subjects in activity log
1 parent f9851c2 commit e63dbfe

4 files changed

Lines changed: 29 additions & 17 deletions

File tree

app/assets/stylesheets/components/_details.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
background-color: nhsuk-colour("white");
2121
font-family: Helvetica, Arial, sans-serif;
2222

23+
h3:first-child {
24+
padding-bottom: nhsuk-spacing(4);
25+
border-bottom: 1px solid $nhsuk-border-colour;
26+
}
27+
2328
.nhsuk-inset-text {
2429
margin-top: 0;
2530
border-color: $nhsuk-border-colour;

app/globals.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,23 @@ export default () => {
113113

114114
// Show email message content if recipient given with email address
115115
if (auditEvent.messageRecipient?.email) {
116+
const subject = nunjucksEnv.renderString(
117+
en.emails.consent[auditEvent.messageTemplate].name,
118+
auditEvent.messageData
119+
)
120+
121+
const body = nunjucksEnv
122+
.render(
123+
`emails/consent/${auditEvent.messageTemplate}.njk`,
124+
auditEvent.messageData
125+
)
126+
.replaceAll('## ', '#### ')
127+
.replaceAll('### ', '##### ')
128+
116129
details.push({
117130
classes: 'app-details--notify-message',
118131
summaryText: `Email sent to ${auditEvent.messageRecipient?.email}`,
119-
html: formatMarkdown(
120-
nunjucksEnv.render(
121-
`emails/consent/${auditEvent.messageTemplate}.njk`,
122-
auditEvent.messageData
123-
)
124-
)
132+
html: formatMarkdown(`### ${subject}\n\n${body}`)
125133
})
126134
}
127135

app/locales/en.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ export const en = {
10561056
},
10571057
'invite-clinic': {
10581058
label: 'Clinic booking',
1059-
name: '{{consent.child.firstName}} has still not had their {{session.vaccinationNames.sentenceCase}}'
1059+
name: '{{child.firstName}} has still not had their {{session.vaccinationNames.sentenceCase}}'
10601060
},
10611061
'invite-clinic-reminder': {
10621062
label: 'Clinic booking reminder',
@@ -1068,28 +1068,28 @@ export const en = {
10681068
},
10691069
'consent-already-vaccinated': {
10701070
label: 'Already vaccinated',
1071-
name: 'You’ve told us that {{consent.child.firstName}} is fully vaccinated against MMR'
1071+
name: 'You’ve told us that {{child.firstName}} is fully vaccinated against MMR'
10721072
},
10731073
'consent-given': {
10741074
label: 'Consent given',
1075-
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
1075+
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{child.firstName}}'
10761076
},
10771077
'consent-given-changed-school': {
10781078
label: 'Consent given (changed school)',
10791079
name: 'Your child’s {{session.vaccinationNames.sentenceCase}}'
10801080
},
10811081
'consent-refused': {
10821082
label: 'Consent refused',
1083-
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
1083+
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{child.firstName}}'
10841084
},
10851085
'consent-followed-up': {
10861086
// Reuses same confirmation as that for consent refused (or given)
10871087
label: 'Consent refusal confirmed',
1088-
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
1088+
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{child.firstName}}'
10891089
},
10901090
'consent-needs-triage': {
10911091
label: 'Consent needs triage',
1092-
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
1092+
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{child.firstName}}'
10931093
},
10941094
'consent-unknown-contact': {
10951095
label: 'Consent response from unknown contact',
@@ -1101,7 +1101,7 @@ export const en = {
11011101
},
11021102
'triage-vaccinate-second-dose': {
11031103
label: 'Vaccinate (second dose)',
1104-
name: '{{consent.child.firstName}} needs another dose of the MMR vaccination'
1104+
name: '{{child.firstName}} needs another dose of the MMR vaccination'
11051105
},
11061106
'triage-delay-vaccination': {
11071107
label: 'Delay vaccination',
@@ -1117,11 +1117,11 @@ export const en = {
11171117
},
11181118
'vaccination-reminder': {
11191119
label: 'Session reminder',
1120-
name: '{{consent.child.fullName}} may get their {{session.vaccinationNames.sentenceCase}} on {{session.formatted.nextDate}}'
1120+
name: '{{child.fullName}} may get their {{session.vaccinationNames.sentenceCase}} on {{session.formatted.nextDate}}'
11211121
},
11221122
'vaccination-already-had': {
11231123
label: 'Vaccination already had',
1124-
name: 'Cancelled {{session.vaccinationNames.sentenceCase}} appointment for {{consent.child.firstName}}'
1124+
name: 'Cancelled {{session.vaccinationNames.sentenceCase}} appointment for {{child.firstName}}'
11251125
},
11261126
'vaccination-deleted': {
11271127
label: 'Vaccination message sent in error',

app/models/session.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,7 @@ export class Session {
570570
sentenceCaseProgrammeName(programme.emailName())
571571
)
572572
)} ${pluralisation}`,
573-
titleCase: `${filters.formatList(this.programmes.map((programme) => programme.emailName()))}
574-
${pluralisation}`
573+
titleCase: `${filters.formatList(this.programmes.map((programme) => programme.emailName()))} ${pluralisation}`
575574
}
576575
}
577576

0 commit comments

Comments
 (0)