File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { DocumentInfo } from './DocumentInfo'
6
6
import * as Handlebars from 'handlebars'
7
7
import { Logger } from 'loglevel'
8
8
import log = require( 'loglevel' )
9
- import moment = require( 'moment' )
10
9
11
10
export class Notification {
12
11
private _configuration : Configuration
@@ -23,16 +22,17 @@ export class Notification {
23
22
24
23
this . _log = log . getLogger ( 'Notification' )
25
24
this . _dryRun = dryRun
25
+ Handlebars . registerHelper ( 'getRecipients' , ( documentInfo : DocumentInfo ) => {
26
+ return documentInfo . getRecipients ( this . _configuration . maintainer , this . _configuration . domain ) . join ( ', ' )
27
+ } )
26
28
}
27
29
28
30
public async notify ( documentInfos : Array < DocumentInfo > ) : Promise < void > {
29
31
const workingDocumentInfos = [ ]
30
32
documentInfos . forEach ( ( entry ) => {
31
33
workingDocumentInfos . push ( DocumentInfo . fromDocumentInfo ( entry ) )
32
34
} )
33
- Handlebars . registerHelper ( 'moment' , ( text , format ) => {
34
- return moment ( text ) . format ( format )
35
- } )
35
+
36
36
const subjectTemplate = Handlebars . compile ( this . _configuration . notificationSubjectTemplate )
37
37
const bodyTemplate = Handlebars . compile ( this . _configuration . notificationBodyTemplate )
38
38
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export class MockServer {
8
8
<p>The following document{{#if multipleDocuments}}s{{/if}} are outdated:</p>
9
9
<ul>
10
10
{{#each documents}}
11
- <li><a href="{{url}}">{{title}}</a> ({{lastVersionDate}}) ({{author}} - {{lastVersionMessage}})</li>
11
+ <li><a href="{{url}}">{{title}}</a> ({{lastVersionDate}}) ({{author}} - {{lastVersionMessage}}) [notified: {{ getRecipients this }}] </li>
12
12
{{/each}}
13
13
</ul>
14
14
<p>Please check, wether the document needs any updates or save the document again stating that it is still valid.</p>
You can’t perform that action at this time.
0 commit comments