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'
66import * as Handlebars from 'handlebars'
77import { Logger } from 'loglevel'
88import log = require( 'loglevel' )
9- import moment = require( 'moment' )
109
1110export class Notification {
1211 private _configuration : Configuration
@@ -23,16 +22,17 @@ export class Notification {
2322
2423 this . _log = log . getLogger ( 'Notification' )
2524 this . _dryRun = dryRun
25+ Handlebars . registerHelper ( 'getRecipients' , ( documentInfo : DocumentInfo ) => {
26+ return documentInfo . getRecipients ( this . _configuration . maintainer , this . _configuration . domain ) . join ( ', ' )
27+ } )
2628 }
2729
2830 public async notify ( documentInfos : Array < DocumentInfo > ) : Promise < void > {
2931 const workingDocumentInfos = [ ]
3032 documentInfos . forEach ( ( entry ) => {
3133 workingDocumentInfos . push ( DocumentInfo . fromDocumentInfo ( entry ) )
3234 } )
33- Handlebars . registerHelper ( 'moment' , ( text , format ) => {
34- return moment ( text ) . format ( format )
35- } )
35+
3636 const subjectTemplate = Handlebars . compile ( this . _configuration . notificationSubjectTemplate )
3737 const bodyTemplate = Handlebars . compile ( this . _configuration . notificationBodyTemplate )
3838
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export class MockServer {
88 <p>The following document{{#if multipleDocuments}}s{{/if}} are outdated:</p>
99 <ul>
1010 {{#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>
1212 {{/each}}
1313 </ul>
1414 <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